This topic describes how to migrate a MySQL database from Tencent Cloud to Alibaba Cloud and the corresponding precautions.
- You have created an RDS instance.
- You have created an account with read and write permissions.
- Structure migration does not support migration of events.
- For MySQL databases, DTS reads floating-point values (FLOAT and DOUBLE data types)
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.
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
- 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.
- Log on to the DTS console.
- In the left-side navigation pane, click Data Migration. In the upper-right corner of the main workspace, click Create Migration Task.
- Enter information about the source and target databases. The following table describes
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.
- 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.
- Click Set Whitelist and Next.
- 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.
- 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.
- 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.
- Wait until the migration task is completed.