All Products
Search
Document Center

Data Transmission Service:Precautions and limits for migrating data from a MySQL database

Last Updated:Jan 29, 2024

This topic describes the precautions and limits when you use Data Transmission Service (DTS) to migrate data from a MySQL database, such as a self-managed MySQL database or an ApsaraDB RDS for MySQL instance. To ensure that your data migration task runs as expected, read the precautions and limits before you configure the task.

Scenarios of migrating data from a MySQL database

The following list provides the scenarios of migrating data from a MySQL database. The precautions and limits in the scenarios may vary. You can go to the related section to view the precautions and limits in a specific scenario.

Migrate data between MySQL databases

The following table describes the precautions and limits when you migrate data to a MySQL database, such as a self-managed MySQL database or an ApsaraDB RDS for MySQL instance.

Category

Description

Limits on the source database

  • Bandwidth requirements: The server to which the source database belongs 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 need to edit the tables in the destination database, such as renaming tables or columns, up to 1,000 tables can be migrated 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 in batches, or configure a task to migrate the entire database.

  • If you want to migrate incremental data, make sure that the following requirements are 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 cannot 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 local binary logs of the source database must be stored for at least seven days. Otherwise, DTS may fail to obtain the binary logs, which causes the task to fail, or even data inconsistency and data loss. Make sure that you configure the retention period of binary logs based on the preceding requirements. Otherwise, the service level agreement (SLA) of DTS does not guarantee service reliability or performance.

  • Limits on operations that are performed on the source database:

    • During schema migration and full data migration, do not perform DDL operations 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 may occur between the source and destination databases. To ensure data consistency, we recommend that you select Schema Migration, Full Data Migration, and Incremental Data Migration as the migration types.

Other limits

  • To ensure compatibility, we recommend that you use the same engine versions for the source and destination MySQL databases.

  • 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 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 size of used tablespace of the destination database is larger than that of the source database.

  • 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 tasks. 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 the task logs. For more information about how to view the 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, 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 source MySQL database, data may be written only to the memory. As a result, data loss occurs.

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 an extended period of 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 runs on an ApsaraDB RDS for MySQL instance:

    If you want to migrate incremental data, you cannot use a read-only ApsaraDB RDS for MySQL instance that does not record transaction logs, such as an ApsaraDB RDS for MySQL V5.6 instance, as the source instance.

  • If the destination database runs on an ApsaraDB RDS for MySQL instance:

    DTS automatically creates a destination database in the ApsaraDB RDS for MySQL instance. However, if the name of the source database is invalid, you must manually create a database in the ApsaraDB RDS for MySQL instance before you configure the data migration task. For more information, see Manage databases.

Migrate data from a MySQL database to a PolarDB for MySQL cluster

The following table describes the precautions and limits when you migrate data from a MySQL database to a PolarDB for MySQL cluster.

Category

Description

Limits on the source database

  • Bandwidth requirements: The server to which the source database belongs 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 need to edit the tables in the destination database, such as renaming tables or columns, up to 1,000 tables can be migrated 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 in batches, or configure a task to migrate the entire database.

  • If you want to migrate incremental data, make sure that the following requirements are 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 cannot 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 local binary logs of the source database must be stored for at least seven days. Otherwise, DTS may fail to obtain the binary logs, which causes the task to fail, or even data inconsistency and data loss. Make sure that you configure the retention period of binary logs based on the preceding requirements. Otherwise, the service level agreement (SLA) of DTS does not guarantee service reliability or performance.

  • Limits on operations that are performed on the source database:

    • During schema migration and full data migration, do not perform DDL operations 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 may occur between the source and destination databases. To ensure data consistency, we recommend that you select Schema Migration, Full Data Migration, and Incremental Data Migration as the migration types.

Other limits

  • To ensure compatibility, we recommend that you use the same engine versions for the source and destination MySQL databases.

  • 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 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 size of used tablespace of the destination database is larger than that of the source database.

  • 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 tasks. 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.

  • DTS does not support the conversion of data from the datetime type to the varchar type.

  • 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 the task logs. For more information about how to view the task logs, see View task logs.

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 an extended period of 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 runs on an ApsaraDB RDS for MySQL instance:

    If you want to migrate incremental data, you cannot use a read-only ApsaraDB RDS for MySQL instance that does not record transaction logs, such as an ApsaraDB RDS for MySQL V5.6 instance, as the source instance.

  • If the destination database runs on a PolarDB for MySQL cluster, take note of the following limits:

    • DTS automatically creates a database in the PolarDB for MySQL cluster. However, if the name of the source database does not meet the requirements of PolarDB for MySQL, you must create a database in the PolarDB for MySQL cluster before you configure the data migration task. For more information, see Database Management.

    • You cannot enable throttling for full data migration.

Migrate data from a MySQL database to a PolarDB-X instance

The following table describes the precautions and limits when you migrate data from a MySQL database to a PolarDB-X instance.

Category

Description

Limits on the source database

  • Bandwidth requirements: The server to which the source database belongs 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 need to edit the tables in the destination database, such as renaming tables or columns, up to 1,000 tables can be migrated 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 in batches, or configure a task to migrate the entire database.

  • If you want to migrate incremental data, make sure that the following requirements are 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 cannot 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 local binary logs of the source database must be stored for at least seven days. Otherwise, DTS may fail to obtain the binary logs, which causes the task to fail, or even data inconsistency and data loss. Make sure that you configure the retention period of binary logs based on the preceding requirements. Otherwise, the service level agreement (SLA) of DTS does not guarantee service reliability or performance.

  • Limits on operations that are performed on the source database:

    • During full data migration, do not perform DDL operations 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 may occur between the source and destination databases. To ensure data consistency, we recommend that you select Full Data Migration and Incremental Data Migration as the migration types.

Other limits

  • The storage type of the PolarDB-X instance must be ApsaraDB RDS for MySQL, which refers to custom ApsaraDB RDS for MySQL instances. PolarDB for MySQL cannot be used as the storage type.

  • Schema migration is not supported. Before you configure a data migration task, you must create databases and tables in the destination instance.

  • 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 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 size of used tablespace of the destination database is larger than that of the source database.

  • 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 tasks. 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.

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 an extended period of 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 runs on an ApsaraDB RDS for MySQL instance:

    If you want to migrate incremental data, you cannot use a read-only ApsaraDB RDS for MySQL instance that does not record transaction logs, such as an ApsaraDB RDS for MySQL V5.6 instance, as the source instance.

Migrate data from a MySQL database to an AnalyticDB for MySQL cluster

The following table describes the precautions and limits when you migrate data from a MySQL database to an AnalyticDB for MySQL cluster.

Category

Description

Limits on the source database

  • Bandwidth requirements: The server to which the source database belongs 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 need to edit the tables in the destination database, such as renaming tables or columns, up to 1,000 tables can be migrated 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 in batches, or configure a task to migrate the entire database.

  • If you want to migrate incremental data, make sure that the following requirements are 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 cannot 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 local binary logs of the source database must be stored for at least seven days. Otherwise, DTS may fail to obtain the binary logs, which causes the task to fail, or even data inconsistency and data loss. Make sure that you configure the retention period of binary logs based on the preceding requirements. Otherwise, the service level agreement (SLA) of DTS does not guarantee service reliability or performance.

  • Limits on operations that are performed on the source database:

    • During schema migration and full data migration, do not perform DDL operations to change the schemas of databases or tables. Otherwise, the data migration task fails.

    • During data migration, do not perform DDL operations to add comments. Otherwise, the data migration task fails. For example, do not execute the ALTER TABLE table_name COMMENT='Table comment'; statement.

    • If you perform only full data migration, do not write data to the source database during data migration. Otherwise, data inconsistency may occur between the source and destination databases. To ensure data consistency, we recommend that you select Schema Migration, Full Data Migration, and Incremental Data Migration as the migration types.

Other limits

  • Prefix indexes cannot be migrated. If the source database contains prefix indexes, data may fail to be migrated.

  • Due to the limits of AnalyticDB for MySQL clusters, if the disk space usage of the nodes in an AnalyticDB for MySQL cluster exceeds 80%, the performance of data writing to the destination database is compromised, and the DTS task is delayed. We recommend that you estimate the required disk space based on the objects to be migrated. You must make sure that the destination cluster has sufficient storage space.

  • 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 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 size of used tablespace of the destination database is larger than that of the source database.

  • 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 tasks. 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 the task logs. For more information about how to view the task logs, see View task logs.

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 an extended period of 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 runs on an ApsaraDB RDS for MySQL instance:

    If you want to migrate incremental data, you cannot use a read-only ApsaraDB RDS for MySQL instance that does not record transaction logs, such as an ApsaraDB RDS for MySQL V5.6 instance, as the source instance.

Migrate data from a MySQL database to a self-managed Kafka cluster

The following table describes the precautions and limits when you migrate data from a MySQL database to a self-managed Kafka cluster.

Category

Description

Limits on the source database

  • Bandwidth requirements: The server to which the source database belongs 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 need to edit the tables in the destination database, such as renaming tables or columns, up to 1,000 tables can be migrated 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 in batches, or configure a task to migrate the entire database.

  • If you want to migrate incremental data, make sure that the following requirements are met:

    • The binary logging feature is enabled in the ApsaraDB RDS console. For more information, see Modify instance parameters. 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 cannot be started.

      Important

      If the source database is a self-managed MySQL database that is 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. For more information, see Create an account for a self-managed MySQL database and configure binary logging.

    • The local binary logs of the source database must be stored for at least seven days. Otherwise, DTS may fail to obtain the binary logs, which causes the task to fail, or even data inconsistency and data loss. Make sure that you configure the retention period of binary logs based on the preceding requirements. Otherwise, the SLA of DTS does not guarantee service reliability or performance. For more information about the binary log files of an ApsaraDB RDS for MySQL instance, see Manage binary log files.

  • Limits on operations that are performed on the source database:

    • During schema migration and full data migration, do not perform DDL operations 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 may occur between the source and destination databases. To ensure data consistency, we recommend that you select Schema Migration, Full Data Migration, and Incremental Data Migration as the migration types.

Limits on the destination database

  • Before you configure a data migration task, you must create a Kafka cluster of version 0.10.1.0 to 2.0.

  • You can select only tables as the objects to be migrated.

  • 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 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 size of used tablespace of the destination database is larger than that of the source database.

  • 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 tasks. 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.

  • We recommend that you do not use tools other than DTS to write data to the destination database. Otherwise, data inconsistency may occur between the source and destination databases.

  • If the destination Kafka cluster is upgraded or downgraded during data migration, you must restart the cluster.

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 an extended period of 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 runs on an ApsaraDB RDS for MySQL instance:

    If you want to migrate incremental data, you cannot use a read-only ApsaraDB RDS for MySQL instance that does not record transaction logs, such as an ApsaraDB RDS for MySQL V5.6 instance, as the source instance.

Migrate data from a MySQL database to a DataHub project

The following table describes the precautions and limits when you migrate data from a MySQL database to a DataHub project.

Category

Description

Limits on the source database

  • Bandwidth requirements: The server to which the source database belongs 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 need to edit the tables in the destination database, such as renaming tables or columns, up to 1,000 tables can be migrated 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 in batches, or configure a task to migrate the entire database.

  • If you want to migrate incremental data, make sure that the following requirements are met:

    • The binary logging feature is enabled in the ApsaraDB RDS console. For more information, see Modify instance parameters. 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 cannot be started.

      Important

      If the source database is a self-managed MySQL database that is 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. For more information, see Create an account for a self-managed MySQL database and configure binary logging.

    • The local binary logs of the source database must be stored for at least seven days. Otherwise, DTS may fail to obtain the binary logs, which causes the task to fail, or even data inconsistency and data loss. Make sure that you configure the retention period of binary logs based on the preceding requirements. Otherwise, the SLA of DTS does not guarantee service reliability or performance. For more information about the binary log files of an ApsaraDB RDS for MySQL instance, see Manage binary log files.

  • Limits on operations that are performed on the source database: During schema migration, do not perform DDL operations to change the schemas of databases or tables. Otherwise, the data migration task fails.

Other limits

  • Only tables can be selected as the objects to be migrated.

  • A single string in the destination DataHub project cannot exceed 2 MB in length.

  • We recommend that you do not use a tool such as pt-online-schema-change to perform DDL operations on the objects to be migrated during data migration. Otherwise, data migration may fail.

  • You can use Data Management (DMS) to perform online DDL operations. For more information, see Perform lock-free DDL operations.

    Warning

    If you use tools other than DTS to write data to the destination database, we recommend that you do not use DMS to perform online DDL operations. Otherwise, data loss may occur in the destination database.

  • 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 tasks. 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.

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 an extended period of 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 runs on an ApsaraDB RDS for MySQL instance:

    If you want to migrate incremental data, you cannot use a read-only ApsaraDB RDS for MySQL instance that does not record transaction logs, such as an ApsaraDB RDS for MySQL V5.6 instance, as the source instance.