This topic describes how to migrate data from a MaxCompute project to an ApsaraDB RDS for MySQL instance by using Data Transmission Service (DTS).
Prerequisites
Precautions
- 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%.
- DTS automatically creates a database in the destination ApsaraDB RDS for MySQL instance.
However, if the name of the source database is invalid, you must manually create a
database in the destination instance before you configure the data migration task.
Note For more information about the naming conventions of ApsaraDB RDS and how to create a database, see Create databases and accounts for an ApsaraDB RDS for MySQL instance.
- To ensure data consistency, we recommend that you do not write data to the source MaxCompute project during full data migration.
- If a data migration task fails, DTS automatically resumes the task. Before you switch your workloads to the destination instance, stop or release the data migration task. Otherwise, the data in the source database overwrites the data in the destination instance after the task is resumed.
- MaxCompute does not support the PRIMARY KEY constraint. If network errors occur, DTS retries the data migration task. In this case, duplicate data records may be migrated to the destination tables that do not have primary keys.
- DTS cannot migrate incremental data from a MaxCompute project to an ApsaraDB RDS for
MySQL instance.
Note To ensure data consistency, we recommend that you do not write data to the source MaxCompute project during data migration.
Supported destination database types
You can use DTS to migrate data to the following types of MySQL databases:
- Self-managed database hosted on Elastic Compute Service (ECS)
- Self-managed database connected over Express Connect, VPN Gateway, or Smart Access Gateway
- Self-managed database connected over Database Gateway
- ApsaraDB RDS for MySQL instances that are owned by the same Alibaba Cloud account as the MaxCompute project or a different Alibaba Cloud account from the MaxCompute project
Note If your destination database is a self-managed MySQL database, you must deploy the
network environment for the source database. For more information, see Preparation overview.
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 Pricing. |
Migration types
Migration type | Description |
---|---|
Schema migration | DTS migrates the schemas of required objects to the destination database. DTS supports
schema migration for views, tables, and databases.
Warning In this topic, the source and the destination databases 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 required objects to the destination database.
Note During full data migration, concurrent INSERT operations cause fragmentation in the
tables of the destination database. After full data migration is complete, the size
of used tablespace of the destination database is larger than that of the source database.
|