This topic describes how to migrate a MySQL database from Tencent Cloud to Alibaba Cloud and the corresponding precautions.

Prerequisites

Limits

  • Structure migration does not support migration of events.
  • For MySQL databases, DTS reads floating-point values (FLOAT and DOUBLE data types) with round(column,precision). If the column definition does not specify the precision, the precision is 38 for FLOAT values and 308 for DOUBLE values.
  • If the object name mapping function is used for an object, migration of objects relying on the object may fail.
  • For incremental migration, you need to enable binary logging for the MySQL instance in the source database.
  • For incremental migration, binlog_format of the source database must be set to ROW.
    Note You can modify parameters of Tencent Cloud databases by choosing Manage Database > Parameter Settings.
  • For incremental migration, if the source instance has binlog file ID disorder caused by cross-host migration, the incremental migration may have data loss.

Precaution

DTS automatically attempts to recover abnormal tasks of the past seven days. This may cause the new data in the target instance to be overwritten by the source database data. Therefore, you must revoke the write permission of the DTS account that is used to access the target instance by running the revoke command.

Procedure

  1. Log on to your MySQL database instance on Tencent Cloud. On the Instance Details page, view the details of Public IP, including the domain name and port.
    Note If an Internal IP address is not enabled, you need to click Enable, and then click OK in the displayed dialog box.


  2. Log on to the DTS Console.
  3. In the left-side navigation pane, click Data Migration. In the right pane, click Create Migration Task in the upper-right corner.
  4. Enter information about the source and target databases. The following table describes the parameters.
    Database type Parameter Description
    Source database (on Tencent Cloud) Instance Type Type of the instance in the source database. Select On-premises Databases.
    Instance Region If you have configured access control for your instance, you need to allow the specified Internet IP segment of the region to access the instance before configuring a migration task.
    Note You can click Get DTS IP to view and copy the IP segment of the region.
    Database Engine Source database type. Select MySQL.
    Host Name or IP Address Domain name in Public IP
    Port Port in Public IP
    Database account Default superuser account root
    Database Password Password of the root account
    Target database (on Alibaba Cloud) Instance Type Type of the instance in the target database. Select RDS Instance.
    Instance Region Region of the target instance
    RDS Instance ID ID of the instance in the selected region. Select the ID of the target instance.
    Database account An account with read and write permissions under the target instance
    Database Password Account password
    Connection method Select Non-encrypted connection or SSL secure connection. The latter greatly increases CPU consumption.


  5. Click Test the Connection and confirm that the test results for both the source and target databases are Test passed.
  6. Click Authorize Whitelist and Enter into Next Step.
  7. Select the migration type. In the Migration objects area, select the target database and click to add the database to the Selected objects area.
    Note To maintain data consistency before and after migration, we recommend that you migrate the structure, full data, and incremental data.


  8. Click Pre-check and Start and wait until the pre-check ends.
    Note If the check fails, you can rectify faults according to error items and restart the task.


  9. Click Next. In the Confirm Purchase Configuration dialog box, read and confirm you agree to the Service Terms of Data Transmission (Pay-As-You-Go) and click Buy and Start Now.
    Note Currently, structure migration and full migration are free of charge, while incremental migration is charged by the hour according to link specifications.
  10. Wait until the migration task is completed.