MongoDB
UDTS supports mutual migration between MongoDB (self-built/UDB MongoDB/standard MongoDB services provided by other cloud manufacturers) single nodes, replica sets, and shard sets.
The source and target database versions support 3.0 to 6.0. Due to cross-version compatibility issues, migration across major versions is not supported. For example, when migrating from 3.x to 5.x, you need to create a 4.x version of the transit database, first migrate from 3.x to 4.x, and then migrate from 4.x to 5.x.
Function Limitations
- Do not migrate system built-in libraries, including config/local/admin
- When the source or target MongoDB version is lower than 3.6, DDL is not supported for incremental migration
- When the source database is a sharded cluster, DDL is not supported for incremental migration
- During incremental migration, the source database must enable oplog.
Migration of Replica Sets
- When the source database address is a single address, the task can temporarily run after the source database cluster switches between master and slave, but the task cannot start when it fails/stops and restarts.
- When the target database address is a single address, the task may run abnormally after the target database cluster switches between master and slave, and the task cannot start when it fails/stops and restarts.
- When the source/target database is a replica set, it is recommended to fill in the primary and secondary addresses at the same time, such as
primary:port,secondary:port
. In this way, after the source/target database switches between master and slave, the task will automatically switch to the newprimary
node to continue running. - When the source/target database is UMongoDB NVMe type, fill in all addresses in the access address.
Migration of Sharded Clusters
- When the source database is a sharded cluster, you need to fill in the mongos address, all shard addresses, and the Config Server node address.
- When the target is a sharded cluster, the migration address needs to fill in the mongos routing address.
- The Balancer of the source database needs to be turned off before migration.
- Clean up orphan documents in the source database to prevent id conflict issues during migration.
- When both the source database and the target database are sharded clusters, the shard keys in the source database will also be migrated by default.
Attention
- MongoOplogTs needs to be filled in UTC time, for example:
2021-03-01T12:10:10Z
- Example of filling in UDB MongoDB replica set, fill in all addresses.
- When migrating across versions, please pay attention to whether there are features in the source database that are not compatible with the target database.
MySQL Form Filling
Instructions for filling out the form for replica set or single node source
Parameter Name | Description |
---|---|
Address | Provides three types of addresses: internal network address, external network address, and dedicated line address. The internal network address requires filling in VPC and subnet information, and the external network address supports both IP and domain names. For a replica set, fill in all node addresses, such as: 192.168.1.100:27017,192.168.1.120:27017,192.168.1.130:27017 |
Authorized DB | Authorized database name, UDB MongoDB defaults to admin |
Collection | Collection, MongoDB document group |
Database Name | MongoDB database name. To transfer the entire database (except the admin system database), please fill in *; to transfer a specific database, please fill in the database name; currently does not support transferring multiple databases |
Username | MongoDB connection username |
Password | Password for the corresponding MongoDB database user |
MongoOplogTs | (Only needs to be filled in for incremental tasks) The oplog position at the start of the increment, i.e., the synchronization point for the increment, in the format 1970-01-01T00:00:00Z (UTC time) |
Instructions for Filling Out the Shard Set Source Form
Parameter Name | Description |
---|---|
Data Node IP and Port | Fill in the addresses of all shards in the shard set source database, each shard fills in one line, such as: 192.168.1.100:27017,192.168.1.120:27017,192.168.1.130:27017 For multiple shards, please fill in on different lines, such as three shards fill in three lines: 192.168.1.100:27017,192.168.1.120:27017,192.168.1.130:27017 192.168.1.101:27017,192.168.1.121:27017,192.168.1.131:27017 192.168.1.102:27017,192.168.1.122:27017,192.168.1.132:27017 |
Routing Node Address | The mongos address of the shard cluster, such as: 192.168.2.126:27017,192.168.2.136:27017 |
Configuration Node Address | The Config server address of the shard cluster, such as: 192.168.1.200:27017,192.168.1.220:27017,192.168.1.230:27017 |
Authorization DB | Authorization database name, UDB MongoDB defaults to admin |
Collection | Collection, MongoDB document group |
Database Name | MongoDB database name. To transfer the entire database (except the admin system database), please fill in *; to transfer a specific database, please fill in the database name; currently does not support specifying multiple database transfers |
Username | MongoDB connection username (Fill in this item for the same username and password, please fill in separately for different roles) |
Password | Password for the corresponding user of the MongoDB database (Fill in this item for the same username and password, please fill in separately for different roles) |
Form Filling for Replica Set or Sharded Cluster Target
Parameter Name | Description |
---|---|
Address | Provide intranet address. For replica set, fill in all node addresses, such as: 192.168.1.100:27017,192.168.1.120:27017,192.168.1.130:27017 For sharded cluster, fill in mongos routing address, such as: 192.168.1.100:27017,192.168.1.120:27017 |
AuthDB | Authorized database name, UDB MongoDB defaults to admin |
Username | MongoDB connection username |
Password | Password for the corresponding MongoDB database user |