Live migration in MongoDB Atlas enables users to import data from MongoDB deployments running in other environments and cut over to a fully managed database service, giving you industry best practice security by default, advanced features to streamline operations and performance optimization, and the latest versions of MongoDB.
Today, we’re introducing two new enhancements to MongoDB Atlas live migration that make it easier than ever for users to take advantage of the official cloud database service for MongoDB with minimal impact to their applications.
- Previously, live migration could only be performed on a replica set running MongoDB version 3.0 and above. MongoDB Atlas now supports live migrations of replica sets running MongoDB 2.6, making it easier for users running older versions to transition to a fully managed service and a more recent version of the database software.
- Live migrations will now also support sharded clusters, meaning that some of the world’s largest MongoDB workloads can now be moved to MongoDB Atlas with less effort and minimal impact to production applications.
Live migrate from MongoDB 2.6 to 3.2+
Upgrading to a new database version may seem like routine work for some, but, as battle-hardened IT operators know, can have complexities and require plenty of strategy and foresight.
Between all the applications and end users you have, the prospect of upgrading to a new release can be a major undertaking requiring significant planning. While some of our Enterprise and Community customers love to upgrade to the latest release as soon as possible to get new features and performance improvements, others take a more measured approach to upgrading.
To make upgrading easier, we are excited to announce that we have extended database version support for the live migration tool in MongoDB Atlas. MongoDB users running older versions of the database can now easily update to the latest versions of the database and migrate to the best way to run MongoDB in the cloud, all at the same time.
Using live migration, you can migrate from any MongoDB 2.6 replica set to a MongoDB 3.2+ cluster on Atlas. This requires no backend configuration, no downtime, and no upgrade scripting. Once our migration service is able to communicate with your database, it will do all the heavy lifting.
The migration service works by:
- Performing a sync between your source database and a target database hosted in MongoDB Atlas
- Syncing live data between your source database and the target database by tailing the oplog
- Notifying you when it’s time to cut over to the MongoDB Atlas cluster
Given that you’re upgrading a critical part of your application, you do need to be wary of how your application’s compatibility with the database might change, and for that we recommend the following stages are included in your upgrade plan:
- Upgrade your application to make use of the latest MongoDB drivers, and make any necessary code changes
- Create a staging environment on MongoDB Atlas
- Use the live migration tool to import your data from your existing MongoDB replica
- Deploy a staging version of your updated application and connect it to your newly created MongoDB Atlas staging environment
- Perform thorough functional and performance tests to ensure behavior is as expected
- Re-use the live migration tool to import your production data when ready, and then perform the hard cutover in databases and application versions
Live migrate sharded clusters
Until today, migrating a sharded MongoDB deployment with minimal downtime has been difficult. The live migration tool now makes this possible for customers looking to move their data layer into MongoDB Atlas.
When performing a live migration on a sharded cluster, we recommend that in addition to following the process listed above, that you also consider the following:
- Our live migration service will need access to all your shards and config servers, in addition to your mongos servers
- You can only migrate across like database versions e.g. 3.2 to 3.2, 3.4 to 3.4, etc.
- You must migrate from and to the same number of shards
- For full details on sharded live migrations, click here
Ready to migrate to MongoDB Atlas? Get started here.