This topic provides an overview of the solutions to migrate and synchronize data to or from MongoDB databases in different scenarios.
Notes
ApsaraDB for MongoDB automatically updates the minor version of the instance to the latest version if the minor version of an ApsaraDB for MongoDB instance expires or is not included in the maintenance list and when you perform some operations. This ensures that the ApsaraDB for MongoDB instance can provide higher performance and stability. For more information, see Database version upgrade, Data migration, Overview, Restore backup data to a new ApsaraDB for MongoDB instance by backup point, Restore backup data to a new ApsaraDB for MongoDB instance by point in time, and Restore one or more databases of an ApsaraDB for MongoDB instance.
Limits
Standalone instances do not support incremental data migration or synchronization.
Data migration solutions
- You can use the following methods to migrate the data of a MongoDB database:
Notice Standalone instances do not support incremental data migration.
- Use Data Transmission Service (DTS) to fully or incrementally migrate the data of a MongoDB database. This enables you to smoothly migrate data from a MongoDB database to the cloud without affecting business. For more information about DTS, see What is DTS?
- Use the official MongoDB tools such as mongodump and mongorestore to fully migrate the data of a MongoDB database.
- Use a physical or logical backup file to migrate the data of an ApsaraDB for MongoDB instance to an on-premises database.
- The following table describes data migration methods in different scenarios.
Migration scenario Source instance architecture References Migrate data from a self-managed database to an ApsaraDB for MongoDB instance Standalone or replica set instance Migrate an ECS-hosted self-managed MongoDB database that uses the standalone or replica set architecture to ApsaraDB for MongoDB Sharded cluster instance Migrate an ECS-hosted self-managed MongoDB database that uses the sharded cluster architecture to ApsaraDB for MongoDB Standalone instance Replica set instance Sharded cluster instance Migrate data from a third-party cloud database to an ApsaraDB for MongoDB instance Replica set or sharded cluster instance Migrate data between ApsaraDB for MongoDB instances Replica set instance Migrate data from an ApsaraDB for MongoDB replica set instance to an ApsaraDB for MongoDB sharded cluster instance Standalone instance Migrate data from a standalone instance to a replica set or sharded cluster instance Standalone or replica set instance Migrate data between ApsaraDB for MongoDB instances of different Alibaba Cloud accounts Standalone, replica set, or sharded cluster instance Migrate data between ApsaraDB for MongoDB instances across regions Migrate data from an ApsaraDB for MongoDB instance to a self-managed MongoDB database Replica set instance
Data synchronization solutions
- You can use the following methods to synchronize the data of a MongoDB database:
Notice Standalone instances do not support data synchronization.
- Use DTS to synchronize data between MongoDB databases.
- Use the MongoShake tool developed by Alibaba Cloud to synchronize data between MongoDB databases.
- The following table describes data synchronization methods in different scenarios.
Synchronization scenario Tool References Synchronize data between instances DTS Synchronize data to an existing instance MongoShake Use MongoShake to implement one-way synchronization between ApsaraDB for MongoDB replica set instances