This topic provides an overview of the solutions to migrate and synchronize data to or from an ApsaraDB for MongoDB database in different scenarios.

Data migration solutions

You can fully or incrementally migrate the data of a MongoDB database by using Data Transmission Service (DTS). For more information, see What is DTS. The full migration and incremental migration can achieve smooth data migration from a MongoDB database to the cloud without affecting businesses.

ApsaraDB for MongoDB supports full data migration by using the official mongodump and mongorestore tools.

In addition, ApsaraDB for MongoDB allows you to migrate data from the cloud to an on-premises database by using a physical or logical backup file.

Migration scenario Source database architecture Reference
Migrate data from a user-created or on-premises database to Alibaba Cloud Standalone Migrate user-created standalone MongoDB databases to ApsaraDB for MongoDB through DTS
Migrate data from a user-created database to Alibaba Cloud by using tools provided by MongoDB
Replica set Use DTS to migrate data
Use the built-in commands of MongoDB to migrate data
Sharded cluster Use DTS to migrate data
Use the built-in commands of MongoDB to migrate data
Migrate data from a database on a third-party cloud platform to Alibaba Cloud N/A Migrate data from an Amazon DynamoDB database to Alibaba Cloud
Replica set or sharded cluster
Migrate data between ApsaraDB for MongoDB instances Replica set Migrate data in a MongoDB replica set instance to a sharded cluster instance
Standalone Migrate data from a standalone MongoDB instance to a replica set or sharded cluster instance
Standalone or replica set Use DTS to migrate MongoDB databases between different Alibaba Cloud accounts
Migrate data from an ApsaraDB for MongoDB instance to a user-created or on-premises MongoDB database Replica set Restore logical backup data in a user-created MongoDB instance
Restore ApsaraDB for MongoDB physical backup data in a user-created MongoDB instance

Data synchronization solutions

You can use the Alibaba Cloud-developed MongoShake tool to synchronize data between MongoDB databases.

Synchronization scenario Tool Reference
Synchronize data to an existing instance MongoShake Implement one-way synchronization between ApsaraDB for MongoDB replica set instances using MongoShake