ApsaraDB for RDS is a stable, reliable, and scalable online database service. ApsaraDB for RDS provides a complete database solution that includes disaster recovery, data backup, data recovery, and data migration. This topic describes how to migrate data from an Apsara PolarDB for MySQL cluster to an ApsaraDB RDS for MySQL instance by using Data Transmission Service (DTS).
Prerequisites
- The binary logging feature is enabled for the source Apsara PolarDB for MySQL cluster. For more information, see Enable binlogging.
- An ApsaraDB RDS for MySQL instance is created. For more information, see Create an ApsaraDB RDS for MySQL instance.
Precautions
- DTS uses read and write resources of the source and destination databases during full data migration. This may increase the database load. If the database performance is unfavorable, the specification is low, or the data volume is large, database services may become unavailable. For example, DTS occupies a large amount of read and write resources in the following cases: a large number of slow SQL queries are performed on the source database, the tables have no primary keys, or a deadlock occurs in the destination database. Before you migrate data, evaluate the performance of the source and destination databases. We recommend that you migrate data during off-peak hours. For example, you can migrate data when the CPU usage of the source and destination databases is less than 30%.
- The source database must have PRIMARY KEY or UNIQUE constraints and all fields must be unique. Otherwise, the destination database may contain duplicate data records.
- During full data migration, concurrent INSERT operations cause fragmentation in the tables of the destination database. After full data migration is complete, the tablespace of the destination database is larger than that of the source database.
- If a data migration task fails, DTS automatically resumes the task. Before you switch your workloads to the destination database, stop or release the data migration task. Otherwise, the data in the source database will overwrite the data in the destination database after the task is resumed.
Limits
- DTS supports schema migration for the following types of objects: table, view, trigger,
stored procedure, and function.
Note During schema migration, DTS changes the value of the SECURITY attribute from
DEFINER
toINVOKER
for views, stored procedures, and functions. - DTS does not migrate user information from the source database. Before a user can call views, stored procedures, and functions of the destination database, you must grant the read/write permissions to the user.
Migration types
DTS supports schema migration, full data migration, and incremental data migration.
For more information, see Terms.
Note When you migrate data between Apsara PolarDB for MySQL clusters, you can select all
of the supported migration types to ensure service continuity.
Billing
Migration type | Instance configurations | Internet traffic |
---|---|---|
Schema migration and full data migration | Free of charge. | Charged only when data is migrated from Alibaba Cloud over the Internet. For more information, see Pricing. |
Incremental data migration | Charged. For more information, see Pricing. |
SQL operations that can be synchronized during incremental data migration
Operation type | SQL statement |
---|---|
DML | INSERT, UPDATE, DELETE, and REPLACE |
DDL |
|
Permissions required for database accounts
Database | Permission |
---|---|
Apsara PolarDB for MySQL | The read permission on the objects to be migrated |
ApsaraDB RDS for MySQL | The read/write permissions on the objects to be migrated |
Note For more information about how to create and authorize a database account, see Create database accounts and Create an account for an ApsaraDB RDS for MySQL instance.