This topic describes how to migrate data from a Baidu RDS for MySQL instance to an Alibaba Cloud RDS instance and the corresponding precautions.

Prerequisites

Limits

  • Schema migration does not support the migration of events.
  • DTS reads floating-point values (including float values and double values) in a column of the MySQL database by using the round(column,precision) method. If precision is not specified, the precision is 38 for float values and 308 for double values. Therefore, you must check whether the migration precision meets your service expectations.
  • If object name mapping is enabled for an object, other objects depending on this object may fail to be migrated.
  • If Incremental Data Migration is selected, binary logging must be enabled for the source MySQL instance.
  • If Incremental Data Migration is selected, the binlog_format parameter of the source database must be set to row.
  • If Incremental Data Migration is selected and the version of the source MySQL instance is 5.6 or later, the binlog_row_image parameter of the source MySQL instance must be set to full.
  • If Incremental Data Migration is selected and binlog file ID disorder occurs in the source MySQL instance because of cross-host migration or reconstruction during incremental migration, the incremental data being migrated may be lost.
Note You can choose Manage Database > Parameter Settings to reconfigure parameters.

Precautions

DTS attempts to restore abnormal tasks executed within the last seven days. This may lead to data in the source database overwriting the service data that has been written to the destination database. Therefore, after a migration task is completed, you must use the REVOKE statement to revoke the write permission of the DTS account that is used to access the destination instance.

Procedure

  1. Log on to the Baidu RDS for MySQL instance and enable Public Network Access. On the Basic Information tab, view and copy the values of Domain and Port.
  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 the information of the source and destination databases. The following table describes the parameters.
    Database type Parameter Description
    Source database (on Baidu Cloud) Instance Type The type of the source instance. Select User-Created Database with Public IP Address.
    Instance Region The region where the source instance resides. If you have configured access control for the instance, you must allow the specified public IP addresses of the corresponding region to access the instance before configuring a migration task.
    Note You can click Get IP Address Segment of DTS to view and copy the public IP addresses of the region where DTS resides.
    Database Type The type of the source database. Select MySQL.
    Hostname or IP Address The domain name in Public IP of the source database.
    Port The port number in Public IP of the source database.
    Database Account The default privileged account: root.
    Database Password The password of the root account.
    Destination database (on Alibaba Cloud) Instance Type The type of the destination instance. Select RDS Instance.
    Instance Region The region where the destination instance resides.
    RDS Instance ID The ID of the destination instance in the specified region.
    Database Account The account with read and write permissions in the destination instance.
    Database Password The password of the specified account.
    Encryption The mode for accessing the destination instance. Select Non-encrypted or SSL-encrypted. The latter greatly increases CPU consumption.

    源库和目标库信息
  5. Click Test Connectivity and confirm that the test results for both the source and destination databases are Passed.
  6. Click Set Whitelist and Next.
  7. Select a migration type. In the Available list, select the source database and click 右箭头 to add the database to the Selected list.
    Note To guarantee data consistency before and after migration, we recommend that you select Schema Migration, Full Data Migration, and Incremental Data Migration.

    迁移类型和迁移对象
  8. Click Precheck and wait until the precheck ends.
    Note If the precheck fails, you can fix the problems as instructed and run the precheck again.

    源库和目标库信息
  9. Click Next. In the Confirm Settings dialog box that appears, read the terms and select Data Transmission Service (Pay-As-You-Go) Service Terms, and click Buy and Start.
    Note Schema Migration and Full Data Migration are free of charge, whereas Incremental Data Migration charges users on an hourly basis based on link specifications.
  10. Wait until the migration task is completed.
    等待迁移任务完成