This topic describes how to migrate a self-managed standalone MongoDB database to an ApsaraDB for MongoDB instance by using Data Transmission Service (DTS).
You can also use the built-in commands of MongoDB to migrate self-managed MongoDB databases. For more information, see Migrate self-managed MongoDB databases to standalone instances by using tools provided by MongoDB.
For more information about data migration or synchronization solutions, see Overview.
Prerequisites
- The version of the self-managed MongoDB database is 3.0, 3.2, or 3.4.
- The available storage space of the ApsaraDB for MongoDB instance is larger than the total size of the data in the self-managed MongoDB database.
Precautions
- To prevent service disruptions, we recommend that you migrate data during off-peak hours.
- If the source and destination MongoDB databases use different versions or storage engines, make sure that your applications can run on both databases. For more information about the versions and storage engines that are supported by ApsaraDB for MongoDB, see MongoDB versions and storage engines.
- You cannot use DTS to migrate incremental data from a self-managed standalone MongoDB database because the oplog feature cannot be enabled for the database.
- The admin or local database cannot be used as the source or destination database.
Billing
Migration type | Task configuration fee | Internet traffic fee |
---|---|---|
Full data migration | Free of charge. | Charged only when data is migrated from Alibaba Cloud over the Internet. For more information, see Pricing. |
Migration types
Full data migration: DTS migrates all historical data of the source MongoDB database to the destination MongoDB database.Permissions required for database accounts
Database | Full data migration |
---|---|
Self-managed MongoDB database | The read permissions on the source database |
ApsaraDB for MongoDB instance | The read and write permissions on the destination database |
For more information about how to create and authorize a database account, see the following topics:
- Self-managed MongoDB database: db.createUser()
- ApsaraDB for MongoDB instance: Manage user permissions on MongoDB databases