This topic describes the precautions and limits when you migrate data from a PolarDB for MySQL cluster. 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 PolarDB for MySQL cluster

You can view the precautions and limits based on the following migration scenarios:

Migrate data between PolarDB for MySQL clusters

The following table describes the precautions and limits.
Type Description
Limits on the source database
  • Bandwidth requirements: The server to which the source database belongs must have sufficient egress bandwidth. Otherwise, the data migration speed is affected.
  • The source database must have PRIMARY KEY or UNIQUE constraints and all fields must be unique. Otherwise, the destination database may contain duplicate data records.
  • If you want to migrate incremental data, you must make sure that the following requirements are met:
    • The binary logging feature must be enabled. The value of the binlog_format parameter must be set to row. The value of the binlog_row_image parameter must be set to full. Otherwise, error messages are returned during precheck and the data migration task cannot be started.
    • Binary logs are retained for at least 7 days during full data migration. You can wait until full data migration is complete, and then clear the binary logs generated in the source database after the DTS task is run.
      Note To ensure data security, DTS stores only 50 GB of binary logs or the binary logs for the last 24 hours. If the limit is exceeded, DTS automatically clears the cached logs.
      Warning If you clear the binary logs of the source database during full data migration, the data migration task may fail. For example, full data migration takes more than 24 hours due to the large data volume in the source database and abnormal writing in the destination database. In this case, if the binary logs of the source database are cleared during full data migration, DTS cannot obtain the binary logs generated 24 hours ago. Therefore, the data migration task may fail.
  • Limits on operations:
    • During schema migration and full data migration, do not perform data definition language (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 will be inconsistent 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 MySQL versions for the source and destination PolarDB clusters.
  • 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 of 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 meets 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 the FLOAT data type to 38 digits and the precision for 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 instance, stop or release the data migration task. You can also run the revoke command to revoke the write permissions from the accounts that are used by DTS to access the destination instance. Otherwise, the data in the source database will overwrite the data in the destination instance after the task is resumed.

Migrate data from a PolarDB for MySQL cluster to an ApsaraDB RDS for MySQL instance or a self-managed MySQL database

The following table describes the precautions and limits.
Type Description
Limits on the source database
  • Bandwidth requirements: The server to which the source database belongs must have sufficient egress bandwidth. Otherwise, the data migration speed is affected.
  • The source database must have PRIMARY KEY or UNIQUE constraints and all fields must be unique. Otherwise, the destination database may contain duplicate data records.
  • If you want to migrate incremental data, you must make sure that the following requirements are met:
    • The binary logging feature must be enabled. The value of the binlog_format parameter must be set to row. The value of the binlog_row_image parameter must be set to full. Otherwise, error messages are returned during precheck and the data migration task cannot be started.
    • Binary logs are retained for at least 7 days during full data migration. You can wait until full data migration is complete, and then clear the binary logs generated in the source database after the DTS task is run.
      Note To ensure data security, DTS stores only 50 GB of binary logs or the binary logs for the last 24 hours. If the limit is exceeded, DTS automatically clears the cached logs.
      Warning If you clear the binary logs of the source database during full data migration, the data migration task may fail. For example, full data migration takes more than 24 hours due to the large data volume in the source database and abnormal writing in the destination database. In this case, if the binary logs of the source database are cleared during full data migration, DTS cannot obtain the binary logs generated 24 hours ago. Therefore, the data migration task may fail.
  • Limits on operations:
    • During schema migration and full data migration, do not perform data definition language (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 will be inconsistent 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.
Precautions
  • 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 of 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 meets 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 the FLOAT data type to 38 digits and the precision for 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 instance, stop or release the data migration task. You can also run the revoke command to revoke the write permissions from the accounts that are used by DTS to access the destination instance. Otherwise, the data in the source database will overwrite the data in the destination instance after the task is resumed.
Special cases If you migrate data to 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 Create a database on an ApsaraDB RDS for MySQL instance.

Migrate data from a PolarDB for MySQL cluster to a PolarDB-X instance

The following table describes the precautions and limits.
Type Description
Limits on the source database
  • Bandwidth requirements: The server to which the source database belongs must have sufficient egress bandwidth. Otherwise, the data migration speed is affected.
  • The source database must have PRIMARY KEY or UNIQUE constraints and all fields must be unique. Otherwise, the destination database may contain duplicate data records.
  • If you want to migrate incremental data, you must make sure that the following requirements are met:
    • The binary logging feature must be enabled. The value of the binlog_format parameter must be set to row. The value of the binlog_row_image parameter must be set to full. Otherwise, error messages are returned during precheck and the data migration task cannot be started.
    • Binary logs are retained for at least 7 days during full data migration. You can wait until full data migration is complete, and then clear the binary logs generated in the source database after the DTS task is run.
      Note To ensure data security, DTS stores only 50 GB of binary logs or the binary logs for the last 24 hours. If the limit is exceeded, DTS automatically clears the cached logs.
      Warning If you clear the binary logs of the source database during full data migration, the data migration task may fail. For example, full data migration takes more than 24 hours due to the large data volume in the source database and abnormal writing in the destination database. In this case, if the binary logs of the source database are cleared during full data migration, DTS cannot obtain the binary logs generated 24 hours ago. Therefore, the data migration task may fail.
  • Limits on operations:
    • 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 will be inconsistent 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.
    • Incremental DDL operations cannot be migrated. If you perform DDL operations in the source database during incremental data migration, the data migration task fails. If you need to perform DDL operations, we recommend that you perform the operations in the destination database and then perform the operations in the source database.
Precautions
  • Schema migration is not supported. Before you configure a data migration task, you must create databases and tables in the destination instance.
  • The storage type of the PolarDB-X instance must be ApsaraDB RDS for MySQL (private custom RDS instance). PolarDB for MySQL cannot be used as the storage type.
  • 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 of 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 meets 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 the FLOAT data type to 38 digits and the precision for 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 instance, stop or release the data migration task. You can also run the revoke command to revoke the write permissions from the accounts that are used by DTS to access the destination instance. Otherwise, the data in the source database will overwrite the data in the destination instance after the task is resumed.

Migrate data from a PolarDB for MySQL cluster to a self-managed Oracle database

The following table describes the precautions and limits.
Type Description
Limits on the source database
  • Bandwidth requirements: The server to which the source database belongs must have sufficient egress bandwidth. Otherwise, the data migration speed is affected.
  • The source database must have PRIMARY KEY or UNIQUE constraints and all fields must be unique. Otherwise, the destination database may contain duplicate data records.
  • If you want to migrate incremental data, you must make sure that the following requirements are met:
    • The binary logging feature must be enabled. The value of the binlog_format parameter must be set to row. The value of the binlog_row_image parameter must be set to full. Otherwise, error messages are returned during precheck and the data migration task cannot be started.
    • Binary logs are retained for at least 7 days during full data migration. You can wait until full data migration is complete, and then clear the binary logs generated in the source database after the DTS task is run.
      Note To ensure data security, DTS stores only 50 GB of binary logs or the binary logs for the last 24 hours. If the limit is exceeded, DTS automatically clears the cached logs.
      Warning If you clear the binary logs of the source database during full data migration, the data migration task may fail. For example, full data migration takes more than 24 hours due to the large data volume in the source database and abnormal writing in the destination database. In this case, if the binary logs of the source database are cleared during full data migration, DTS cannot obtain the binary logs generated 24 hours ago. Therefore, the data migration task may fail.
  • Limits on operations:
    • During schema migration and full data migration, do not perform data definition language (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 will be inconsistent 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.
Precautions
  • 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 of 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 meets 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 the FLOAT data type to 38 digits and the precision for 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 instance, stop or release the data migration task. You can also run the revoke command to revoke the write permissions from the accounts that are used by DTS to access the destination instance. Otherwise, the data in the source database will overwrite the data in the destination instance after the task is resumed.