You can use Data Transmission Service (DTS) to migrate data from a MySQL database to a PolarDB for MySQL cluster.
Supported source databases
You can use DTS to migrate data from the following types of MySQL databases to a PolarDB for MySQL cluster. This topic uses an ApsaraDB RDS for MySQL instance as an example to describe how to configure a data migration task. You can also follow the procedure to configure data migration tasks for other types of MySQL databases.- ApsaraDB RDS for MySQL instance
- Self-managed databases:
- Self-managed database with a public IP address
- Self-managed database that is hosted on Elastic Compute Service (ECS)
- Self-managed database that is connected over Express Connect, VPN Gateway, or Smart Access Gateway
- Self-managed database that is connected over Database Gateway
Prerequisites
- The source ApsaraDB RDS for MySQL instance is created. For more information, see Create an ApsaraDB RDS for MySQL instance.
- The destination PolarDB for MySQL cluster is created. For more information, see Purchase a pay-as-you-go cluster and Purchase a subscription cluster.
- The available storage space of the destination PolarDB for MySQL cluster is larger than the total size of the data in the source ApsaraDB RDS for MySQL instance.
Limits
Category | Description |
---|---|
Limits on the source database |
|
Other limits |
|
Special cases |
|
Migration types
- Schema migration
DTS migrates the schemas of the required objects from the source database to the destination database.
Note- DTS supports schema migration for the following types of objects: table, view, trigger, stored procedure, and function.
- During schema migration, DTS changes the value of the SECURITY attribute from DEFINER to INVOKER for views, stored procedures, and functions.
- DTS does not migrate user information. To call a view, stored procedure, or function of the destination database, you must grant the read and write permissions to INVOKER.
- Full data migration
DTS migrates historical data of the required objects from the source database to the destination database.
- Incremental data migration
After full data migration is complete, DTS migrates incremental data from the source database to the destination database. Incremental data migration allows you to ensure service continuity when you migrate data between self-managed databases.
SQL operations that can be migrated
Operation type | SQL statements |
---|---|
DML | INSERT, UPDATE, and DELETE |
DDL |
|
Permissions required for database accounts
Database | Schema migration | Full data migration | Incremental data migration |
---|---|---|---|
ApsaraDB RDS for MySQL instance | The SELECT permission | The SELECT permission | The REPLICATION CLIENT, REPLICATION SLAVE, SHOW VIEW, and SELECT permissions |
PolarDB for MySQL cluster | The read and write permissions |
For more information about how to create and authorize a database account, see the following topics:
- ApsaraDB RDS for MySQL instance: Create an account on an ApsaraDB RDS for MySQL instance and Modify the permissions of a standard account on an ApsaraDB RDS for MySQL instance
- PolarDB for MySQL cluster: Create a database account