Migrate from Compose to MongoDB Atlas

Deployment Type:

Author: MongoDB Documentation Team

The MongoDB Atlas Live Migration Service helps you migrate MongoDB databases to our fully managed cloud database, MongoDB Atlas, quickly and securely. It works by connecting to your existing MongoDB database and synchronizing it with a cluster running in Atlas all while your application continues to function normally. Once the data between the two clusters has been synchronized, you can simply update the database connection string in your application to cut over to your cluster in Atlas.

This guide will walk you through how to use the Atlas Live Migration process to migrate data from mLab to MongoDB Atlas.

Time required: 20 minutes

What You’ll Need

1

MongoDB Atlas account

If you don’t have an Atlas account, create one now.

2

Compose MongoDB deployment

Procedure

1

Create an Atlas deployment

If you don’t already have an Atlas deployment, create one now. You’ll need a cluster tier of M10 or larger to perform Live Migration.

2

Log in to your Compose account

Log in to your Compose account and navigate to the deployment you want to migrate to Atlas.

Note

It will be helpful during the migration process to keep one browser window open on your Compose deployment console and one window open on your Atlas console.

3

Create an oplog user

To perform the migration process, you need a database user with permission to read the oplog on your admin database. Click the Add-ons link in the left-side navigation. If you don’t have the Oplog Access add-on, add it with the Add button.

If you already have the Oplog Access add-on, click Configure to see the oplog user username and password. You’ll need them both in subsequent migration steps.

../../_images/compose-oplog-addon.png
4

Begin the Atlas Live Migration process

Navigate to your Atlas cluster. Click the ellipsis () button and select Migrate Data to this Cluster.

../../_images/atlas-deployment.png
5

Review migration steps

Read through the overview of migration steps in the Live Migration dialog window, then click the green I’m ready to migrate button.

6

Add IP address ranges to your Compose deployment whitelist

For this step you’ll need to have browser tabs open with both the Atlas Live Migration process dialog from the previous step and your Compose deployment dashboard.

On your Compose deployment dashboard, click the Security link in the left-side navigation. The Whitelist TCP/HTTP IPs section displays a list of IP address ranges which are allowed to access your Compose deployment. Add all four of the IP address ranges which are listed at the top of the Atlas Migration process dialog window.

../../_images/compose-add-ips.png

Note

Your Atlas migration IP address ranges may be different from those shown here.

7

Add the hostname and port of your Compose deployment to the Atlas Live Migration dialog

On the Oplog Access add-on page, you’ll find a connection string with a hostname and port for oplog access. Copy them to the Atlas Live Migration dialog.

../../_images/compose-hostname.png
8

Enter the oplog user’s credentials in the Live Migration dialog

Enter the username and password for oploguser in the Atlas Live Migration dialog window.

9

Enter your Compose SSL Certificate data

If you don’t have SSL enabled on your Compose deployment, skip this step.

On the Oplog Access add-on page, you’ll find an SSL certificate. Copy it to the CAFile text box on the Atlas Live Migration dialog.

../../_images/compose-cafile.png

Note

Copy the entire certificate file, including the BEGIN CERTIFICATE and END CERTIFICATE lines.

10

Validate your Live Migration form

Click the Validate button to check that all your form fields are valid and your clusters are ready for migration. When your form is validated, click the Start Migration button.

11

Start migration

When the migration process begins, the Live Migration dialog window closes and you are returned to the Atlas cluster overview page. A progress bar shows the progess of your migration.

Once the migration is complete, you can begin to update your client applications to use the new Atlas connection string.

../../_images/migration-complete.png
12

Start your cutover

Your Compose deployment and your Atlas cluster are now in sync. Atlas will maintain this synchronized state for 72 hours. If you need more time, syncing can be extended for another 24 hours.

Click the green Start cutover button and follow the instructions listed in the dialog window.

Summary

You created an Atlas cluster, migrated data from your old Compose cluster, and updated your applications to use the new Atlas Cluster. Congratulations and welcome to MongoDB Atlas!