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 the data, you can use AnalyticDB for MySQL to build systems such as internal business intelligence (BI) systems, interactive query systems, and real-time report systems.
Prerequisites
- The source PolarDB for MySQL cluster is created. For more information, see Purchase a pay-as-you-go cluster and Purchase a subscription cluster.
- 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 | Instance 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 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 the historical data of 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 ensures the service continuity of self-managed applications during data migration.
SQL operations that can be migrated
Operation type | SQL statement |
---|---|
DML | INSERT, UPDATE, and DELETE |
DDL | CREATE TABLE, DROP TABLE, RENAME TABLE, TRUNCATE TABLE, ADD COLUMN, and DROP COLUMN |
- Check whether the data migration task fails because the data type of a field in the source table, such as the customer field, is changed when DTS migrates data to the destination AnalyticDB for MySQL V3.0 cluster.
- In the destination AnalyticDB for MySQL V3.0 cluster, create a table named customer_new that has the same schema as the customer table.
- Execute the INSERT INTO SELECT statement 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 permission |
---|---|
PolarDB for MySQL | Read permissions on the objects to be migrated |
AnalyticDB for MySQL 3.0 | Read and write permissions |
- PolarDB for MySQL cluster: Create a database account
- AnalyticDB for MySQL V3.0 cluster: Create a database account