This topic describes how to migrate data from a PolarDB for MySQL cluster to an AnalyticDB for MySQL V3.0 cluster by using Data Transmission Service (DTS). After you migrate data, you can use AnalyticDB for MySQL to build internal business intelligence (BI) systems, interactive query systems, and real-time report systems.
Prerequisites
- An ApsaraDB RDS for MySQL instance is created. For more information, see Create an ApsaraDB RDS for MySQL instance.
- The destination AnalyticDB for MySQL V3.0 cluster is created. For more information, see Create a cluster.
- The available storage space of the destination AnalyticDB for MySQL cluster is larger than the total size of the data in the source PolarDB for MySQL cluster.
Limits
Category | Description |
---|---|
Limits on the source database |
|
Usage notes |
|
Billing
Migration type | Task configuration fee | Internet traffic fee |
---|---|---|
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 Billing overview. |
Incremental data migration | Charged. For more information, see Billing overview. |
Migration types
- Schema migration
DTS migrates the schemas of the required objects from the source database to the destination database.
Note ApsaraDB RDS for MySQL and AnalyticDB for MySQL are heterogeneous databases. DTS does not ensure that the schemas of the source and destination databases are consistent after schema migration. We recommend that you evaluate the impact of data type conversion on your business. For more information, see Data type mappings between heterogeneous databases. - 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 synchronizes 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 | CREATE TABLE, DROP TABLE, RENAME TABLE, TRUNCATE TABLE, ADD COLUMN, and DROP COLUMN |
- When DTS migrates data to the destination AnalyticDB for MySQL cluster, the data type of a field named customer in the source table is changed. As a result, the data migration task fails.
- In the destination AnalyticDB for MySQL V3.0 cluster, create a table named customer_new. The customer_new table has the same schema as the customer table.
- Run the INSERT INTO SELECT command to copy the data of the customer table and insert the data into the customer_new table. This ensures that the data of the two tables is consistent.
- Rename or delete the customer table. Then, change the name of the customer_new table to customer.
- Restart the data migration task in the DTS console.
Permissions required for database accounts
Database | Required permissions |
---|---|
PolarDB for MySQL | The read permissions on the objects to be migrated |
AnalyticDB for MySQL V3.0 | The read and write permissions |
- PolarDB for MySQL cluster: Create a database account
- AnalyticDB for MySQL V3.0 cluster: Create a database account