×
Community Blog Use DTS to Migrate MySQL Databases Deployed in ACK to PolarDB for MySQL

Use DTS to Migrate MySQL Databases Deployed in ACK to PolarDB for MySQL

This article describes how to use Data Transmission Service (DTS) to migrate a MySQL database from Container Service for Kubernetes (ACK) to PolarDB for MySQL.

1. Solution Overview

This article describes how to use Data Transmission Service (DTS) to migrate a MySQL database from Container Service for Kubernetes (ACK) to PolarDB for MySQL. The solution also supports schema synchronization, full data synchronization, and incremental data synchronization.

Prerequisites

• The version of the MySQL database in ACK is 5.1, 5.5, 5.6, 5.7, or 8.0.

• A PolarDB for MySQL instance is created.

• The cluster network service cannot be a cluster IP.

• Before migrating and synchronizing data, you need to enable binlog for the database in the container.

2. Procedure

2.1 Check ACK Cluster Details

1

Check Nodes.

2

Check StatefulSets.

3

Check pod details.

4

Check the SVC bound to the MySQL container and the network type.

5

As shown in the figure, the Type is NodePort, and the Port Mapping is 30001 using TCP protocol, so we can use the internal IP address of any node to connect to the MySQL container, with the port mapping 30001.

6

2.2 Connect to the MySQL Database in the Cluster Container

Log on to any node and use the internal IP address of the node to connect to container 3306 with port mapping 30001.

7

Connect to the MySQL database in the container.

8

Check the content of the database table in the container database.

9

2.3 Use DTS to Migrate Databases from ACK Containers to PolarDB for MySQL

1.  Go to the DTS console. In the left navigation pane, click Data Migration. In the page that appears, select a region and create a task.

10

2.  Select MySQL as the source database and PolarDB for MySQL as the destination database.

11

3.  Configure source and destination databases.

Category

Parameter

Note

Source Database Details

Instance Type

The type of the source database. Select User-Created Database in ECS Instance.

Instance Region

The region that you selected for the source database when you created the data synchronization task.

The ID of the ECS Instance

The ID of the ECS instance on any node of ACK.

Database Type

The database engine that you selected for the source database when you created the data synchronization task. The value of this parameter is set to MySQL.

Port

The port mapping of SVC in ACK, 30001.

Database Account

The account of the MySQL database. The account must have the SELECT permission on the required objects and the REPLICATION CLIENT, REPLICATION SLAVE, and SHOW VIEW permissions.

Database Password

The password for the account of the MySQL database.

Destination Database Details

Instance Type

The type of the destination database. Select PolarDB Instance.

Instance Region

The region that you selected for the destination instance when you created the data synchronization task.

Instance ID

The ID of the destination database.

Database Account

The database account of the destination PolarDB for MySQL cluster.

Database Password

The password of the database account.

Connection Method

Specifies whether to encrypt the connection to the destination database. Select Non-encrypted or SSL-encrypted based on your business and security requirements. If you select SSL-encrypted, you must enable SSL encryption for the ApsaraDB RDS for MySQL instance before you configure the data migration task. For more information, see https://www.alibabacloud.com/help/en/rds/apsaradb-rds-for-mysql/configure-a-cloud-certificate-to-enable-ssl-encryption">Configure SSL encryption for an ApsaraDB RDS for MySQL instance.

12

4.  In the lower-right corner of the page, click Test Connectivity and Proceed.

13
14

5.  Select the database that you want to migrate.

15
16

6.  In the lower-right corner of the page, click Next. Configure initial synchronization.

17
18

7.  In the lower-right corner of the page, click Precheck.

19

8.  Close the Precheck dialog box after the following message is displayed: Precheck Passed. Then, the data synchronization task starts.

The synchronization types are schema migration and full data migration. No fees are charged.

20

9.  You can view the status of the data synchronization task on the Data Migration Tasks page.

21

10.  Click the instance to check the migration progress.

22

11.  Wait until the migration task is complete.

23

3. Check the Destination Data after Migration

1.  Go to the PolarDB -M console and log on to the database.

24
25
26

2.  Verify the count of database tables.

27

Validate data volume consistency between source and destination databases.

0 1 0
Share on

ApsaraDB

564 posts | 179 followers

You may also like

Comments

ApsaraDB

564 posts | 179 followers

Related Products