PolarDB is a next-generation relational distributed cloud native database service that is developed by Alibaba Cloud. PolarDB is fully compatible with MySQL and features benefits such as ease of use, high performance, high availability, and high reliability. You can use Data Transmission Service (DTS) to migrate data between PolarDB for MySQL clusters.
Note PolarDB does not support cross-version upgrade. For example, you cannot directly upgrade
PolarDB for MySQL 5.6 to PolarDB for MySQL 8.0. However, you can create a PolarDB for MySQL cluster of a new version, such as 8.0, and use this method to migrate data from the
source cluster to the new cluster. Before you migrate data across versions of PolarDB
for MySQL clusters, we recommend that you create a pay-as-you-go PolarDB cluster to test the compatibility. After the test is complete, you can release the
cluster.
Prerequisites
- The source and destination PolarDB for MySQL clusters are purchased. For more information, see Create a PolarDB for MySQL cluster.
- Binary logging is enabled for the source PolarDB for MySQL cluster to meet the requirement of incremental data migration. For more information, see Enable binary logging.
Notes
- DTS uses read and write resources of the source and destination databases during full data migration. This may increase the loads of the database servers. 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 impact of data migration on 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 utilization of the source and destination databases is less than 30%.
- If the source database does not have a PRIMARY KEY or UNIQUE constraint and all the fields are not unique, the destination database may contain duplicate data.
- If a data migration task fails, DTS automatically restores the task. Before you switch your business to the destination database, stop or release the data migration task. Otherwise, the data from the source database overwrites the data in the destination database after the task is restored.
Introduction to migration types
DTS supports schema migration, full data migration, and incremental data migration.
For more information, see Terms.
Note When you select all of the three migration types, data between databases can be smoothly
migrated.
Billing description
Migration type | Link configuration fee | Data transfer cost |
---|---|---|
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 | Required permission |
---|---|
Source PolarDB for MySQL | The read permission on the objects to be migrated |
Destination PolarDB for MySQL | The read and write permissions on the objects to be migrated |
Note For more information about how to create and authorize a database account, see Create a PolarDB database account.
Procedure
What to do next
The database accounts that are used for data migration have the read and write permissions. To ensure database security, delete the relevant database accounts after data migration is complete.