This topic describes how to migrate data from a Huawei Cloud RDS for MySQL instance to an ApsaraDB RDS for MySQL instance and provides important usage notes for data migration.
Prerequisites
Source and destination | Requirements | |
Source |
| |
Destination | ApsaraDB RDS for MySQL instance | |
Limits
The schema migration method does not support events.
Data Transmission Service (DTS) reads floating-point values of the FLOAT and DOUBLE data types in MySQL by calling the
round(column,precision)function. If the value precision is not specified by the data type of a column, the precision is 38 bits for FLOAT-type values and 308 bits for DOUBLE-type values. You must check whether the precision of FLOAT-type and DOUBLE-type values that need to be migrated by DTS meets your business requirements.If you use the object name mapping feature on an object, other objects that are dependent on the object may fail to be migrated.
The following list describes the limits on incremental migration:
The binary logging feature must be enabled for the Huawei Cloud RDS for MySQL instance.
The binlog_format parameter of the source database must be set to row.
If the Huawei Cloud RDS for MySQL instance runs MySQL 5.6 or later, the binlog_row_image parameter of the instance must be set to full.
If cross-host migration or reconstruction is performed on the Huawei Cloud RDS for MySQL instance during the incremental data migration, the IDs of binary log files may be disordered and the incremental data that is migrated may be lost.
NoteFor more information about how to modify the parameters of a Huawei Cloud RDS for MySQL instance, see Relational Database Service.
Usage notes
If you configured access control policies for the source instance, you must add the CIDR block of the DTS server to the security settings of the source instance before you configure a migration task.
DTS attempts to automatically resume abnormal migration tasks that are run within seven days. In this case, data on the Huawei Cloud RDS for MySQL instance may overwrite the service data that is written to the ApsaraDB RDS for MySQL instance. After a migration task is complete, you must execute the
revokestatement to revoke the write permissions of the DTS account that is used to access the ApsaraDB RDS for MySQL instance.
Procedure
Go to the Data Migration Tasks page for the required region.
Log on to the DTS console.
In the navigation pane on the left, click Data Migration.
In the top navigation bar, select the required region.
Click Create Task. On the page that appears, configure the source and destination instances.
Section
Parameter
Description
Source Database
Database Type
The type of the source instance. In this example, MySQL is selected.
Access Method
The method that is used by the source instance to access DTS. In this example, Public IP Address is selected.
Instance Region
The region of the source instance. You can select a region as needed. In this example, China (Hangzhou) is selected.
Domain Name or IP
The public endpoint of the source instance.
Port
The port number of the source instance.
Database Account
The username of the privileged account of the source instance.
Database Password
The password of the privileged account of the source instance.
Destination Database
Database Type
The type of the destination instance. In this example, MySQL is selected.
Access Method
The method that is used by the destination instance to access DTS. In this example, Alibaba Cloud Instance is selected.
Instance Region
The region of the destination instance.
Replicate Data Across Alibaba Cloud Accounts
In this example, No is selected.
RDS Instance ID
The ID of the destination instance.
Database Account
The username of the privileged account of the destination instance.
Database Password
The password of the privileged account of the destination instance.
Connection Methods
Specifies whether to encrypt the connection to the source database instance. Select Non-encrypted or SSL-encrypted based on your business requirements. If you want to set this parameter to SSL-encrypted, you must enable SSL encryption for the ApsaraDB RDS for MySQL instance before you configure the DTS task. For more information, see Use a cloud certificate to enable SSL encryption.
After you complete the configurations, click Test Connectivity And Proceed. In the DTS Server Access Authorization dialog box, click Test Connectivity And Proceed.
In the Configure Task Objects And Advanced Configurations step, configure the Migration Types parameter.
NoteTo ensure data consistency, we recommend that you select Schema Migration, Full Data Migration, and Incremental Data Migration.
In the Source Objects section, select the database that you want to migrate and click the
icon to move the selected database to the Selected Objects section.Click Next: Advanced Settings. On the page that appears, retain the default parameter settings.
You can migrate an account (including its password and permissions) that meets the migration conditions from the source database to the destination database. For more information, see Migrate database accounts.
Click Next: Save Task Settings And Precheck. Wait until the precheck is complete.
NoteIf the precheck fails, resolve the issues based on the instructions and run the precheck again.
Click Next: Purchase. Then, on the Purchase page, select Data Transmission (Pay-as-You-Go) Service Terms and click Purchase And Start.
If you select Incremental Data Migration and write data to the source instance during the incremental data migration, DTS synchronizes the incremental data to the destination instance. The migration task does not automatically stop. If you want to only migrate data, we recommend that you stop writing data to the source database for a few minutes when the desired data consistency is achieved between the source and destination instances during incremental data migration. When the same level of data consistency is achieved again, stop the migration task and switch the workloads over to the destination instance.
NoteSchema migration and full data migration are provided free of charge. If you use incremental data migration, you are charged on an hourly basis based on link specifications.
Wait until the migration task is complete.