Migrate from Compose to MongoDB Atlas¶
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¶
Compose MongoDB deployment¶
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
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.
Begin the Atlas Live Migration process¶
Navigate to your Atlas cluster. Click the ellipsis (…) button and select Migrate Data to this Cluster.
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.
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.
Your Atlas migration IP address ranges may be different from those shown here.
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.
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.
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.
Copy the entire certificate file, including the
BEGIN CERTIFICATE and
END CERTIFICATE lines.
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.
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.
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.
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!