Navigation

Live Migrate Your Replica Set to Atlas

Atlas can perform a live migration of a source replica set to an Atlas cluster, keeping the cluster in sync with the remote source until you cut your applications over to the Atlas cluster. To begin, click on the ellipsis button and choose Migrate Data to this Cluster from the dropdown menu.

Note

On the Cluster list, the ellipsis button appears beneath the cluster name, as shown below. When you view a cluster’s details, the ellipsis appears on the right-hand side of the screen, next to the Connect and Configuration buttons.

../../_images/live-migrate.png

Note

You cannot select an M0 (Free Tier) or M2/M5 shared cluster as the source or destination for live migration. To migrate data from an M0 (Free Tier) or M2/M5 shared cluster to a paid cluster, see Modify a Cluster.

Atlas requires a period of downtime during the cut over process. Consider scheduling a maintenance period for your application to cover this downtime and allow Atlas live migration to fully sync with the source cluster data.

For a procedure on live migrating a sharded cluster, see Live Migrate Your Sharded Cluster to Atlas.

Prerequisites

Upgrade Path

Atlas live migration supports the following migration paths:

Source Replica Set MongoDB Version Destination Atlas Replica Set MongoDB Version
2.6 3.2 or 3.4 or 3.6
3.0 3.2 or 3.4 or 3.6
3.2 3.2 or 3.4 or 3.6
3.4 3.4 or 3.6
3.6 3.6

3.2 End of Life

MongoDB Server 3.2 is planned for End of Life on September 2018. Atlas deprecated support for deploying clusters with MongoDB 3.2 in March, 2018.

Atlas will automatically upgrade any clusters running MongoDB 3.2 to MongoDB 3.4 in September 2018. Project Owners can upgrade their MongoDB 3.2 clusters at any time before then.

See I have a cluster running MongoDB 3.2. How does the upcoming End of Life affect me? for guidance on how to manage Atlas clusters currently running MongoDB 3.2.

Important

Users migrating from a MongoDB 2.6 cluster should take particular care to update and test their applications in context of the destination Atlas cluster. In general, whenever migrating to a newer version of MongoDB, plan for updating and testing your application in context of the destination migration cluster.

Network Access

Source Cluster Firewall Must Allow Access from Live Migration Server

Atlas Live Migration process streams data through a MongoDB-controlled application server. Atlas provides the IP ranges of the MongoDB Live Migration servers during the Live Migration process. Grant these IP ranges access to your source cluster to allow connectivity to the MongoDB Live Migration server.

Atlas Cluster IP Whitelist Must Allow Access From Your Application Servers

Atlas only allows connections to a cluster from entries in the project’s whitelist. You must add IP addresses such as application servers to the project whitelist manually. Do this before beginning the migration procedure.

Atlas temporarily adds the IP address of the Atlas migration servers to the project whitelist. During the migration procedure, you cannot edit or delete this entry. Atlas removes the entry automatically once the procedure completes.

For documentation on adding entries to the Atlas whitelist, see Add Entries to the Whitelist.

Pre-Migration Validation

Atlas performs a number of validation checks on the source and destination cluster before starting the Live Migration procedure.

Source Cluster Security

Atlas only supports SCRAM for connecting to source clusters enforcing authentication.

If the source cluster enforces authentication, create a user with the same name and password that exists on every shard and the config server replica set. The user must have permission to:

  • Read all databases and collections.
  • Read the oplog.

The readWriteAnyDatabase and clusterAdmin built-in roles provide sufficient privilege for Atlas to perform the Live Migration procedure. Create a user with these roles on the admin database.

Specify the user name and password to Atlas when prompted by the Live Migration procedure.

If the source cluster uses a different authentication mechanism, to connect you can use the Migrate with mongomirror tool to migrate data from the source cluster to the destination Atlas cluster.

Considerations

Destination Cluster Configuration

When configuring the destination cluster, consider the following:

  • The live migration process streams data through a migration application server running in AWS US-East. This implicitly requires two network hops to reach the destination cluster irrespective of the location of the source and destination clusters. Due to the potential latency, the live migration application may not be able to keep up with a source cluster that has an extremely heavy write load. You can instead use the mongomirror tool directly from the source cluster, pointing to the destination Atlas cluster.
  • The live migration process may not be able to keep up with a source cluster whose write workload is greater than what can be transferred and applied to the destination cluster. You may need to scale the destination cluster up to a instance with more processing power, bandwidth or disk IO.
  • The destination Atlas cluster must be a replica set.
  • You cannot select an M0 (Free Tier) or M2/M5 shared tier cluster as the destination for live migration.
  • Do not change the featureCompatibilityVersion flag while Atlas Live Migrate is running.

MongoDB Users and Roles

Atlas does not migrate any user or role data to the destination cluster.

If the source cluster enforced authentication, you must re-create the credentials used by your applications on the destination Atlas cluster. Atlas uses SCRAM for user authentication. See Add MongoDB Users for a tutorial on creating MongoDB users in Atlas.

Procedure

Staging and Production Migrations

Consider performing this procedure twice. Perform a partial migration that stops at the Perform the Cutover step first. This creates an up-to-date Atlas-backed staging cluster to test application behavior and performance using the latest driver version that supports the MongoDB version of the Atlas cluster.

Once you have tested your application, perform the full migration procedure using a separate Atlas cluster to create your Atlas-backed production environment.

Important

Avoid making changes to the source cluster configuration while the Live Migration procedure runs, such as removing replica set members or modifying mongod runtime settings like featureCompatibilityVersion.

1

Create a destination Atlas cluster.

Skip this step if you already have an Atlas cluster as the destination of the live migration process.

Create a new Atlas cluster, configuring it as needed. For complete documentation on creating an Atlas cluster, see Create a Cluster.

Once Atlas has deployed your new cluster, proceed to the next step.

2

Start the Migration Process.

  1. Click the ellipsis button for the destination Atlas cluster. On the Cluster list, the ellipsis button appears beneath the cluster name, as shown below. When you view a cluster’s details, the ellipsis appears on the right-hand side of the screen, next to the Connect and Configuration buttons.

    ../../_images/live-migrate.png
  2. Click Migrate Data to this Cluster.

  3. Atlas displays a walk-through screen with instructions on how to proceed with the live migration. Prepare the information as stated in the walk-through screen, then click I’m Ready To Migrate.

  4. Atlas displays a walk-through screen that collects information required to connect to the source cluster.

    • Atlas displays the IP address of the MongoDB application server responsible for your live migration at the top of the walk-through screen. Configure your source cluster firewall to grant access to the displayed IP address.

    • Enter the hostname and port of the primary member of the source cluster into the provided text box. For example, mongoPrimary.example.net:27017.

    • If the source cluster enforces authentication, enter a username and password into the provided text boxes.

      See Source Cluster Security for guidance on the user permissions required by Atlas live migration.

    • If the source cluster uses TLS/SSL, toggle the SSL button.

    • If the source replica set uses TLS/SSL and is not using a public Certificate Authority (CA), copy the contents of the source cluster’s CA file into the provided text box.

  5. Click Validate to confirm that Atlas can connect to the source replica set.

    If validation fails, check that:

    • You have whitelisted Atlas on your source cluster.
    • The provided user credentials, if any, exist on the source cluster and have the required permissions.
    • The SSL toggle is enabled only if the source cluster requires it.
    • The CA file provided, if any, is valid and correct.
  6. Click Start Migration to start the migration process.

    Once the migration process begins, the Atlas UI displays the Migrating Data walk-through screen for the destination Atlas cluster. This walk-through screen updates as destination cluster proceeds through the migration process, as well as the time remaining for the destination cluster to sync with the source cluster.

When the migration timer and the Start Cut Over button turn green, proceed to the next step.

3

Perform the cut over.

When Atlas detects that the source and destination clusters are nearly in sync, it starts an extendable 72 hour timer to begin the cut over procedure. If the 72 hour period passes, Atlas stops synchronizing with the source cluster. You can extend the time remaining by 24 hours by clicking the Extend time hyperlink below the <time> left to cut over timer.

  1. Once you are prepared to cut your applications over to the destination Atlas cluster, click Start Cut Over.

  2. Atlas displays a walk-through screen with instructions on how to proceed with the cut over.

    Perform the steps described in the walk-through screen to cut over your applications to the Atlas cluster. The walk-through screen provides the cluster connection string your applications use for connectivity.

  3. Once you have completed the cut over procedure and confirmed your applications are working normally with the Atlas cluster, click I’m Done to complete the migration procedure.

Migration Support

If you have any questions regarding migration support beyond what is covered in this documentation, or if you encounter an error during migration, please file a support ticket through the Atlas UI.

To file a support ticket,

  1. Click Support in the left-hand navigation
  2. For Atlas Issue Category, select Other
  3. For Priority, select the appropriate priority. For questions, please select Medium Priority. If there was a failure in migration, please select High Priority.
  4. For Request Summary, please include Live Migration in the your summary.
  5. For More details, please include any other relevant details to your question or migration error.