Migrate to Firestore with MongoDB compatibility

The page provides an overview of how to migrate data to Firestore with MongoDB compatibility. To upload data to your database, use a one-time data import or implement a streaming data migration.

One-time data import

For a one-time data import of a collection, use tools like mongoexport and mongoimport:

  1. Export data from a source database with mongoexport.
  2. Import that data into your Firestore with MongoDB compatibility database with mongoimport. Follow the best practices for bulk data loading.

Streaming data migration

A streaming data migration implements change data capture to include ongoing changes to the database.

The following steps give an overview of the process:

A streaming data migration architecture

  1. Enable change streams on the source database. Change streams require a replica set or a sharded cluster.
  2. Set up a service to capture the change events from your MongoDB change stream.
  3. Create a data pipeline to write data from the captured events to your Firestore with MongoDB compatibility database.

What's next