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 must enable binary logging for the MySQL instance in the source database.
  • For incremental migration, the binlog_format parameter of the source database must be set to ROW.
  • For incremental migration where the version of the source MySQL database is 5.6 or later, the binlog_row_image parameter of the source MySQL database must be set to full.
  • For incremental migration, if the source instance has binlog file ID disorder caused by cross-host migration, the incremental migration may have data loss.
Note You can modify parameters of Tencent Cloud databases by choosing Manage Database > Parameter Settings.

Precautions

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 a public IP address is not enabled, you must 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 upper-right corner of the main workspace, click Create Migration Task.
  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 must 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 Type Source database type. Select MySQL.
    Hostname or IP Address Domain name in Public IP
    Port Number 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 Connectivity for both the source and target databases, and confirm that the test results for both the source and target databases are Test passed.
  6. Click Set Whitelist and Next.
  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 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 select Service Terms of Data Transmission (Pay-As-You-Go), then 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.
    等待迁移任务完成