Category | Description |
Limits on the source database | The server on which the source database is deployed must have sufficient outbound bandwidth. Otherwise, the data migration speed decreases. The tables to be migrated must have PRIMARY KEY or UNIQUE constraints and all fields must be unique. Otherwise, the destination database may contain duplicate data records. If you select tables as the objects to be migrated and you want to modify the tables in the destination database, such as renaming tables or columns, you can migrate up to 1,000 tables in a single data migration task. If you run a task to migrate more than 1,000 tables, a request error occurs. In this case, we recommend that you configure multiple tasks to migrate the tables or configure a task to migrate the entire database. If you want to migrate incremental data, the following requirements for binary logs must be met: The binary logging feature is enabled. The binlog_format parameter is set to row and the binlog_row_image parameter is set to full. Otherwise, error messages are returned during the precheck and the data migration task fails to be started.
Important If the source database is a self-managed MySQL database deployed in a dual-primary cluster, you must set the log_slave_updates parameter to ON. This ensures that DTS can obtain all binary logs. The binary logs of the source database must be stored for at least seven days. Otherwise, DTS may fail to obtain the binary logs and the task may fail. In exceptional circumstances, data inconsistency or loss may occur. Make sure that you configure the retention period of binary logs based on the preceding requirements. Otherwise, the service reliability or performance stated in the Service Level Agreement (SLA) of DTS may not be guaranteed.
Limits on operations to be performed on the source database: During schema migration and full data migration, do not execute DDL statements to change the schemas of databases or tables. Otherwise, the data migration task fails. If you perform only full data migration, do not write data to the source database during data migration. Otherwise, data inconsistency between the source and destination databases occurs. To ensure data consistency, we recommend that you select schema migration, full data migration, and incremental data migration as the migration types.
The data generated by change operation of binary logs, such as data restored from a physical backup or data from a cascade operation, is not recorded and migrated to the destination database when the data migration instance is running.
Note If the change data is not recorded and migrated to the destination database, you can migrate full data again on the premise that your business is not affected. If the source database is MySQL database 8.0.23 or later, and the data to be migrated includes invisible columns, the data of the columns cannot be obtained and data loss occurs.
Note To make the columns visible, run the ALTER TABLE <table_name> ALTER COLUMN <column_name> SET VISIBLE; command. For more information, see Invisible Columns. Tables that do not have primary keys automatically generate invisible primary keys. You need to make the invisible primary keys visible. For more information, see Generated Invisible Primary Keys.
|
Other limits | To ensure compatibility, the versions of the source and destination MySQL databases must be the same. DTS does not migrate data where a parser defined by using comments is used. If the destination database is MySQL database 8.0.23 or later, and the columns to receive data include invisible columns, the destination columns to which the data is written cannot be found. In this case, the DTS instance fails to run and data loss occurs.
Note To make the columns visible, run the ALTER TABLE <table_name> ALTER COLUMN <column_name> SET VISIBLE; command. For more information, see Invisible Columns. Tables that do not have primary keys automatically generate invisible primary keys. You need to make the invisible primary keys visible. For more information, see Generated Invisible Primary Keys.
If you do not use the schema migration feature of DTS in the data migration scenarios, you must ensure the compatibility of the fields. For example, if the field of a source table is of the text type, and the field of a destination table is of the varchar(255) type, the data may be truncated when the source table contains large fields. If the data to be migrated contains information such as rare characters or emojis that takes up four bytes, the destination databases and tables to receive the data must use UTF8mb4 character set.
Note If you use the schema migration feature of DTS, set the instance parameter character_set_server in the destination database to UTF8mb4 character set. Before you migrate data, evaluate the impact of data migration on the performance of the source and destination databases. We recommend that you migrate data during off-peak hours. During full data migration, DTS uses the read and write resources of the source and destination databases. This may increase the loads on the database servers. During full data migration, concurrent INSERT operations cause fragmentation in the tables of the destination database. After full data migration is complete, the tablespace of the destination database is larger than that of the source database. You must make sure that the precision settings for columns of the FLOAT or DOUBLE data type meet your business requirements. DTS uses the ROUND(COLUMN,PRECISION) function to retrieve values from columns of the FLOAT or DOUBLE data type. If you do not specify a precision, DTS sets the precision for columns of the FLOAT data type to 38 digits and the precision for columns of the DOUBLE data type to 308 digits. DTS attempts to resume data migration tasks that failed within the last seven days. Before you switch workloads to the destination database, you must stop or release the failed task. You can also execute the REVOKE statement to revoke the write permissions from the accounts that are used by DTS to access the destination database. Otherwise, the data in the source database overwrites the data in the destination database after a failed task is resumed. If DDL statements fail to be executed in the destination database, the DTS task continues to run. You can view the DDL statements that fail to be executed in task logs. For more information about how to view task logs, see View task logs. If you write column names that differ only in capitalization to the same table in the destination MySQL database, the data migration result may not meet your expectations because the column names in MySQL databases are not case-sensitive. After data migration is complete, that is, the Status of the instance changes to Completed, we recommend that you run the analyze table <table name> command to check whether data is written to the destination table. For example, if a high-availability (HA) switchover is triggered in the destination MySQL database, data may be written only to the memory. As a result, data loss occurs. If the source database is an ApsaraDB RDS for MySQL instance for which the EncDB feature is enabled, full data migration cannot be performed.
Note ApsaraDB RDS for MySQL instances that have the Transparent Data Encryption (TDE) feature enabled support schema migration, full data migration, and incremental data migration. If you want to migrate accounts from the source database to the destination database, you need to learn the prerequisites and precautions. For more information, see Migrate database accounts. If a DTS task fails to run, DTS technical support will try to restore the task within 8 hours. During the restoration, the task may be restarted, and the parameters of the task may be modified.
Note Only the parameters of the task may be modified. The parameters of databases are not modified. The parameters that may be modified include but are not limited to the parameters in the "Modify instance parameters" section of the Modify the parameters of a DTS instance topic.
|
Special cases | If the source database is a self-managed MySQL database, take note of the following limits: If you perform a primary/secondary switchover on the source database when the data migration task is running, the task fails. DTS calculates migration latency based on the timestamp of the latest migrated data in the destination database and the current timestamp in the source database. If no DML operation is performed on the source database for a long time, the migration latency may be inaccurate. If the latency of the data migration task is excessively high, you can perform a DML operation on the source database to update the latency.
Note If you select an entire database as the object to be migrated, you can create a heartbeat table. The heartbeat table is updated or receives data every second. DTS executes the CREATE DATABASE IF NOT EXISTS `test` statement in the source database as scheduled to move forward the binary log file position.
If the source database is an Apsara RDS for MySQL instance, take note of the following limit: In incremental data migration, an ApsaraDB RDS for MySQL instance that does not record transaction logs, such as a read-only ApsaraDB RDS for MySQL V5.6 instance, cannot be used as the source database. DTS executes the CREATE DATABASE IF NOT EXISTS `test` statement in the source database as scheduled to move forward the binary log file position.
If the destination database is an ApsaraDB RDS for MySQL instance, take note of the following limit: DTS automatically creates a database in the destination ApsaraDB RDS for MySQL instance. However, if the name of the source database does not comply with the database naming conventions of ApsaraDB RDS for MySQL, you must manually create a database in the destination ApsaraDB RDS for MySQL instance before you configure the data migration task. For more information, see Manage databases.
|