This topic describes how to migrate data from a PolarDB-X 2.0 instance to an Elasticsearch cluster by using Data Transmission Service (DTS).
Prerequisites
- The source PolarDB-X 2.0 instance that is compatible with MySQL 5.7 is created.
- The destination Elasticsearch cluster is created. For more information, see Create an Alibaba Cloud Elasticsearch cluster.
- The engine versions of the source instance and the destination cluster are supported. For more information, see Overview of data migration scenarios.
- The available storage space of the destination PolarDB-X 2.0 instance is larger than the total size of the data in the source Elasticsearch instance.
Limits
Category | Description |
---|---|
Limits on the source database |
|
Other limits |
|
Precautions | DTS updates the `dts_health_check`.`ha_health_check` table in the source database as scheduled to move forward the binary log file position. |
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 required objects from the source database to the destination database.
- Full data migration
DTS migrates the historical data of 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 incrementally migrated
Operation type | SQL statement |
---|---|
DML | INSERT, UPDATE, and DELETE |
Mappings
The MySQL data types supported by PolarDB-X 2.0 do not exactly match the data types supported by Elasticsearch. DTS converts the data types of the source database to those of the Elasticsearch cluster during schema migration based on the data type mappings between heterogeneous databases. For more information, see Data type mappings between heterogeneous databases.
Permissions required for database accounts
Database | Schema migration | Full data migration | Incremental data migration |
---|---|---|---|
Source PolarDB-X 2.0 instance | SELECT permission | SELECT permission | SELECT permission on the objects to be migrated, and REPLICATION SLAVE and REPLICATION CLIENT permissions. DTS automatically grants these permissions to the database account. |
Destination Elasticsearch cluster | Read and write permissions on the objects to be migrated. The default database account in Elasticsearch clusters is elastic. |
Procedure
Check the index and data
After the state of the data migration task changes to Running, you can use the data visualization tool Kibana to connect to the Elasticsearch cluster. This way, you can check whether the index is created and data is migrated as expected. For more information about how to log on to the Kibana console, see Log on to the Kibana console.