DRS Pre-Check Items
A DRS migration process consists of four phases: task startup, full migration, incremental migration, and task completion. A single full migration task contains three phases. To ensure smooth migration, DRS automatically scans and checks parameters and objects in the source and destination databases before starting a migration task. The following table lists common check items.
Overview
View pre-check itmes based on the source database type of your migration task.
- The following lists the pre-check items for migration tasks with MySQL serving as the source.
- The following lists the pre-check items for migration tasks with MongoDB serving as the source.
- The following lists the pre-check items for migration tasks with DDS serving as the source.
MySQL->MySQL
Category | Check Item | Check Item Details |
---|---|---|
Permissions | Source database permissions |
|
Destination database permissions |
| |
Versions | Source database versions | Versions 5.5, 5.6, 5.7, and 8.0 are supported. |
Destination database versions | Versions 5.5, 5.6, 5.7, and 8.0 are supported. | |
Migration version | The destination database version must be the same as or later than the source database version. | |
Parameters | GTID status | Enable GTID for the source database. If GTID is not enabled for the source database, primary/standby switchover is not supported. DRS tasks will be interrupted and cannot be restored during a switchover. |
Performance parameters | Enable skip-name-resolve for the source database to reduce the possibility of connection timeout. | |
The log_slave_updates parameter of the source database must be enabled. Otherwise, the migration fails. | ||
The binlog_row_image parameter value of the source database must be FULL. Otherwise, the migration fails. | ||
Maximum size of a packet that can be transmitted | If there is a lot of data to be migrated or there are too many fields to be migrated, and the max_allowed_packet value of the source database is too small, the migration task may fail. | |
If there is a lot of data to be migrated or there are too many fields to be migrated, and the max_allowed_packet value of the destination database is too small, data cannot be written to the destination database and the full migration fails. | ||
sql_mode value | If the MyISAM tables are included in the migration objects, the sql_mode value in the destination database cannot be no_engine_substitution. Otherwise, the migration fails. | |
Incremental migration | Binlog status | The binlog of the source database must be enabled and the row-based format must be used during incremental migration. |
Binlog retention period | If the storage space is sufficient, store the source database binlog files as long as possible. The recommended retention period is three days. If you set the period to 0, the migration may fail.
| |
server_id value | During an incremental migration, the server_id value of the MySQL source database must be set.
| |
Session variables | During an incremental migration, if the session variable character_set_client is set to binary, some data may include garbled characters. | |
Destination database | Storage space | The destination DB instance must have sufficient storage space. |
Status | The destination DB instance is running properly. | |
Consistency | Character set | The character set of the destination database must be the same as that of the source database. |
Collation | The collation_server value of the destination database must be the same as that of the source database. | |
Time zone | The time_zone value of the destination database must be the same as that of the source database. | |
Case sensitive | The lower_case_table_names value of the destination database must be the same as that of the source database. | |
Transaction isolation level | The transaction isolation level of the destination database must be the same as that of the source database. | |
Maximum length of the calculation result of the group_concat function | The group_concat_max_len value of the destination database must be the same as that of the source database. | |
server_uuid parameter | The server_uuid values of the destination and source databases must be different. | |
InnoDB check mode | The innodb_strict_mode value of the destination database must be the same as that of the source database. | |
Data block encryption parameter | The block_encryption_mode value of the destination database must be the same as that of the source database. | |
SQL mode | The sql_mode value of the destination database must be the same as that of the source database. | |
Migration objects | Selected objects |
|
Tables without primary keys | Create primary keys for tables as the performance of a table without a primary key is lower than that of a table with a primary key. | |
Associated objects | Associated objects must be migrated at the same time to avoid migration failure caused by missing associated objects. | |
Foreign key reference operations | Cascade operations cannot be performed on tables with foreign keys. If the foreign key index of a table is a common index, the table structure may fail to be created. You are advised to use a unique index. | |
Duplicate names | The destination DB instance cannot contain databases with the same name as the source databases (except the MySQL system database). | |
Table naming rules |
| |
Encrypted table check | If there are encrypted tables in the source database, check whether these tables are supported on the destination database. If the destination database does not support these tables, the task may fail. |
MongoDB->DDS
Category | Check Item | Check Item Details |
---|---|---|
Permissions | Source database permissions |
|
Destination database permissions | The destination database user must have the dbAdminAnyDatabase permission for the admin database and the readWrite permission for the destination database. If the destination database is a cluster instance, the database user must have the clusterManager permission for the admin database. | |
Versions | Source database version | Versions 3.2, 3.4, 3.6, 4.0, 4.2, and 4.4 are supported. |
Destination database version | Versions 3.4, 4.0, 4.2, and 4.4 are supported. | |
Migration version | The destination database version must be the same as or later than the source database version. | |
Incremental migration | Oplog status | During an incremental migration, Oplog of the source database must be enabled. |
Oplog retention period | If the storage space is sufficient, store the source database Oplog for as long as possible. The recommended retention period is three days. | |
Balancer status | If the incremental source data cluster is migrated, the source database balancer must be disabled. | |
Orphaned documents | If the full+incremental data needs to be migrated from the source cluster database, the balancer of the source database must be disabled and orphaned documents must be deleted. | |
Destination database | Storage space | The destination DB instance must have sufficient storage space. |
DRS supports full migration between cluster instances. If the source cluster instance is not sharded, ensure that the size of the primary shard on the destination database is greater than that of the source database. | ||
Status | The destination DB instance is running properly. | |
Maximum number of chunks | Check whether the maximum number of chunks in the destination database is sufficient to support sharding and splitting of the source database. If the maximum number of chunks is reached, chunks are not split and the write performance is negatively affected. | |
Consistency | Collections | Check whether collections in both the source and destination databases are not capped. If not, the migration fails. |
Migration objects | Associated objects | Associated objects must be migrated at the same time to avoid migration failure caused by missing associated objects. |
Referenced roles | If the roles referenced by accounts to be migrated are not migrated to the destination database, the migration may fail. | |
Referenced accounts | If the roles referenced by accounts to be migrated are not migrated to the destination database, the migration may fail. | |
Duplicate names | Destination database cannot contain non-empty collections with the same name as those in the source database. | |
Destination database cannot contain views with the same name as those in the source database. | ||
Naming rules | The source database name cannot contain /\."$ or spaces. The collection name and view name cannot start with system. or contain the dollar sign ($). | |
Composite hash indexes |
| |
Composite hash shard keys | ||
Indexes | Check whether the _id fields in the collections of the source database have indexes. If not, the migration fails. | |
TTL indexes | Due to inconsistency of time zones and clocks between source and destination databases, migrating TTL indexes will cause data inconsistency. | |
The number of indexes | If the number of indexes in the source database exceeds 10, the migration duration is affected. |
DDS->MongoDB
Category | Check Item | Check Item Details |
---|---|---|
Permissions | Source database permissions |
|
Destination database permissions | The destination database user must have the dbAdminAnyDatabase permission for the admin database and the readWrite permission for the destination database. If the destination database is a cluster instance, the database user must have the clusterManager permission for the admin database. | |
Versions | Source database version | Versions 3.2, 3.4, 3.6, 4.0, 4.2, and 4.4 are supported. |
Destination database version | Versions 3.2, 3.4, 3.6, 4.0, 4.2, and 4.4 are supported. | |
Migration version | The destination database version must be the same as or later than the source database version. | |
Incremental migration | Oplog status | During an incremental migration, Oplog of the source database must be enabled. |
Oplog retention period | If the storage space is sufficient, store the source database Oplog for as long as possible. The recommended retention period is three days. | |
Balancer status | If the incremental source data cluster is migrated, the source database balancer must be disabled. | |
Orphaned documents | If the full+incremental data needs to be migrated from the source cluster database, the balancer of the source database must be disabled and orphaned documents must be deleted. | |
Destination database | Storage space | The destination DB instance must have sufficient storage space. |
Status | The destination DB instance is running properly. | |
Maximum number of chunks | Check whether the maximum number of chunks in the destination database is sufficient to support sharding and splitting of the source database. If the maximum number of chunks is reached, chunks are not split and the write performance is negatively affected. | |
Consistency | Collections | Check whether collections in both the source and destination databases are not capped. If not, the migration fails. |
Migration objects | Associated objects | Associated objects must be migrated at the same time to avoid migration failure caused by missing associated objects. |
Duplicate names | Destination database cannot contain non-empty collections with the same name as those in the source database. | |
Destination database cannot contain views with the same name as those in the source database. | ||
Naming rules | The source database name cannot contain /\."$ or spaces. The collection name and view name cannot start with system. or contain the dollar sign ($). | |
The number of indexes | If the number of indexes in the source database exceeds 10, the migration duration is affected. |
- Overview
- MySQL->MySQL
- MongoDB->DDS
- DDS->MongoDB