Join us Sept 17 at .local NYC! Use code WEB50 to save 50% on tickets. Learn more >
MongoDB Event
Docs Menu
Docs Home
/ /
Atlas Architecture Center
/

Migration

You can migrate data from your on-premises MongoDB deployments to Atlas using one of a variety of methods. We recommend using Atlas live migration when possible because it automates many of the tasks with the least amount of downtime, but you can use other tools that accommodate the variety and complexity inherent to database migration.

Atlas live migration automates moving data from on-premises MongoDB databases to Atlas. Atlas live migration includes the following features:

You can have a live migration server pull data into Atlas. The pull live migration method supports migration paths between specific MongoDB versions. See Supported Migration Paths to learn more. To migrate data from databases using unsupported versions of MongoDB, see Legacy Migration or Manual Migration Methods.

  • Pull data into Atlas. Atlas pulls data from the source MongoDB deployment and requires access to the source deployment through the deployment's firewall. When the clusters are fully synced, you must follow the cutover process of stopping write operations on the source, redirect applications to the Atlas cluster, and restart them. The following considerations apply:

    • Best for deployments not monitored by Cloud Manager or Ops Manager.

    • The source database must be publicly accessible to allow inbound access from the live migration server.

    • Doesn't support VPC peering or private endpoints for either the source or destination cluster.

    • Source and destination cluster topologies must match. For example, both must be replica sets or sharded clusters with the same number of shards.

    • Plan for minimal downtime during cutover, to stop writes and restart applications with a new connection string. The migration process is CPU-intensive on the destination cluster and requires significant network bandwidth.

    • To ensure a smooth migration process, confirm that the source cluster's oplog size is adequate to cover the entire migration duration. For the source cluster, the live migration's lag window should stay within the bounds of the oplog replication lag window. You can fulfill this requirement by increasing the minimum oplog window or by increasing the fixed oplog size. For the destination cluster, MongoDB recommends that you choose a destination cluster tier that is at least two tiers above the source cluster for the duration of the migration. If storage auto-scaling is disabled on the destination cluster, increase the oplog size on the destination cluster to a high enough fixed value. If storage auto-scaling is enabled on the destination cluster, set a high enough minimum oplog window on the destination cluster. See Oplog Requirements to learn more.

    • For full migration recommendations and instructions, see Live Migrate (Pull) a Cluster into Atlas.

To review both ongoing and past migrations, navigate to the Migration Hub page in Atlas.

You can click each migration process for more detailed information, including the initial data copy time estimate and comprehensive progress reports. Use the cluster card to create, cutover, or cancel a migration.

To learn more, see Monitor Migrations.

If Atlas live migration can't satisfy the constraints of your migration requirements, you can bring data from existing MongoDB deployments, JSON, or CSV files into Atlas using one of the following tools that you run outside of Atlas.

Tool
Description

The mongosync binary is the primary process used by Atlas live migration. You can use standalone mongosync to migrate data from one cluster to a cluster in Atlas. Atlas syncs data from the source to the destination cluster until you cut your applications over to the destination Atlas cluster.

Migrate from a MongoDB replica set into an Atlas cluster without shutting down your existing replica set or applications. mongomirror does not import user/role data or copy the config database.

Seed an Atlas cluster with a BSON data backup dump taken from mongodump, of an existing MongoDB deployment. mongorestore does not restore system.profile collection data.

Load data from a JSON or a CSV file into an Atlas cluster. mongoimport uses strict mode representation for certain BSON types. Note that using mongoimport should be limited to small datasets for testing and/or development purposes.

Use a GUI to load data from a JSON or a CSV file into an Atlas cluster. Note that using MongoDB Compass should be limited to small datasets for testing and/or development purposes.

You can also restore from an Atlas cluster backup data to another Atlas cluster. For information, see Restore Your Cluster.

If you are required to use either Atlas VNet peering or Private Link configurations, you don't want to allow direct connection from a third party to its source cluster, or if you don't already have or don't want to import the source cluster in Ops Manager or Cloud Manager, then MongoDB recommends the standalone mongosync approach.

If you have relatively small datasets (<300 GB) to migrate, and can afford application downtime for an extended time period, then MongoDB recommends the mongodump and mongorestore approach.

If you have relatively small datasets (<300 GB) to migrate, no index concerns, and can afford application downtime for an extended time period, then MongoDB recommends the mongoexport and mongoimport approach.

When a migration reaches the "Ready for Cutover" status, click Cutover on target cluster followed by the Prepare to Cutover on the cluster card to initiate the cutover process. Upon successful completion of the cutover, reconfigure your application to point to the new destination cluster.

To learn more, see Monitor Migrations.

See the Guidance for Atlas Orgs, Projects, and Clusters page to learn about the building blocks of your Atlas enterprise estate or use the left navigation to find features and best practices for each Well-Architected Framework pillar.

Back

Orgs, Projects, and Clusters

On this page