Migrate from PolarDB-X 2.0 to PolarDB-X 1.0
This topic describes how to use Data Transmission Service (DTS) to migrate data from a PolarDB-X 2.0 instance to a PolarDB-X 1.0 instance.
This feature is in beta testing and is available only to some users.
Prerequisites
You have created a target PolarDB-X 1.0 instance with a storage space larger than the data size of the source PolarDB-X 2.0 instance. For more information, see Create an instance.
You have created a database and tables in the target PolarDB-X 1.0 instance to store the migrated data. For more information, see Create a database and Execute basic SQL operations.
NoteKeep the names of the database and tables in the destination instance the same as the names in the source PolarDB-X 2.0 instance. If you use different names, you must use the object name mapping feature in the Selected Objects section of the Configure Objects page.
Notes
Type | Description |
Source database limits |
|
Other limits |
|
Billing
Migration type | Link configuration fee | Data transfer cost |
Full data migration | Free of charge. | This example is free of charge. If you set Access Method for the destination database to Public IP Address, you are charged for data transfer over the Internet. |
Incremental data migration | Charged. For more information, see Billing overview. |
SQL operations supported by incremental migration
Operation type | SQL operation statement |
DML | INSERT, UPDATE, DELETE |
DDL | CREATE TABLE, RENAME TABLE, ALTER TABLE, DROP TABLE, TRUNCATE TABLE, CREATE INDEX, DROP INDEX Note
|
Required permissions for database accounts
Database | Full migration | Incremental migration |
Source PolarDB-X 2.0 | SELECT permission. | REPLICATION SLAVE, REPLICATION CLIENT, and SELECT permissions on the objects to be migrated. |
Destination PolarDB-X 1.0 instance | Read and write permissions. | |
To create and grant permissions to a database account:
For a PolarDB-X 2.0 instance, see Manage database accounts and Account permission issues during data synchronization.
For a PolarDB-X 1.0 instance, see Manage database accounts.
Procedure
Go to the migration task list page of the destination region. You can use one of the following methods.
From the DTS console
Log on to the Data Transmission Service (DTS) console.
In the navigation pane on the left, click Data Migration.
In the upper-left corner of the page, select the region where the migration instance is located.
From the DMS console
NoteThe actual operations may vary based on the mode and layout of the DMS console. For more information, see Simple mode console and Customize the layout and style of the DMS console.
Log on to the Data Management (DMS) console.
In the top navigation bar, choose .
To the right of Data Migration Tasks, select the region where the migration instance is located.
Click Create Task to go to the task configuration page.
Configure the source and destination databases.
Category
Configuration
Description
None
Task Name
DTS automatically generates a task name. We recommend that you specify a descriptive name for easy identification. The name does not need to be unique.
Source Database
Select Existing Connection
To use a database instance that has been added to the system (created or saved), select the desired database instance from the drop-down list. The database information below will be automatically configured.
NoteIn the DMS console, this parameter is named Select a DMS database instance..
If you have not registered the database instance with the system, or do not need to use a registered instance, manually configure the database information below.
Database Type
Select PolarDB-X 2.0.
Access Method
Select Alibaba Cloud Instance.
Instance Region
Select the region of the source PolarDB-X 2.0 instance.
Replicate Data Across Alibaba Cloud Accounts
In this example, a database instance under the current Alibaba Cloud account is used. Select No.
Instance ID
Select the ID of the source PolarDB-X 2.0 instance.
Database Account
Enter the database account of the source PolarDB-X 2.0 instance. For information about the required permissions, see Required permissions for database accounts.
Database Password
Enter the password for the database account.
Destination Database
Select Existing Connection
To use a database instance that has been added to the system (created or saved), select the desired database instance from the drop-down list. The database information below will be automatically configured.
NoteIn the DMS console, this parameter is named Select a DMS database instance..
If you have not registered the database instance with the system, or do not need to use a registered instance, manually configure the database information below.
Database Type
Select PolarDB-X 1.0.
Access Method
Select Alibaba Cloud Instance.
Instance Region
Select the region of the destination PolarDB-X 1.0 instance.
Instance ID
Select the ID of the destination PolarDB-X 1.0 instance.
Database Account
Enter the database account of the destination PolarDB-X 1.0 instance. For information about the required permissions, see Required permissions for database accounts.
Database Password
Enter the password for the database account.
After you complete the configuration, click Test Connectivity and Proceed at the bottom of the page.
NoteEnsure that the DTS service IP address segments are automatically or manually added to the security settings of the source and destination databases to allow access from DTS servers. For more information, see Add DTS server IP addresses to a whitelist.
Configure the task objects.
On the Configure Objects page, configure the objects to be migrated.
Configuration
Description
Migration Types
If you only need to perform a full migration, select Full Data Migration.
To perform a migration with no downtime, select both Full Data Migration and Incremental Data Migration.
NoteIf you do not select Incremental Data Migration, do not write new data to the source instance during data migration to ensure data consistency.
Incremental CDC Type
Select an option based on the log engine of your PolarDB-X 2.0 instance.
NoteThis parameter is available only if you select Incremental Data Migration for Migration Types.
If you want to select Multi-stream CDC, make sure that multi-stream is enabled for your PolarDB-X 2.0 instance. For more information, see Enable multi-stream.
Processing Mode of Conflicting Tables
Precheck and Report Errors: Checks whether tables with the same names exist in the destination database. If no tables with the same names exist, the precheck item is passed. If tables with the same names exist, an error is reported during the precheck phase, and the data migration task does not start.
NoteIf a table in the destination database has the same name but cannot be easily deleted or renamed, you can change the name of the table in the destination database. For more information, see Object name mapping.
Ignore Errors and Proceed: Skips the check for tables with the same names.
WarningSelecting Ignore Errors and Proceed may cause data inconsistency and business risks. For example:
If the table schemas are consistent and a record in the destination database has the same primary key value as a record in the source database:
During full migration, DTS keeps the record in the destination cluster. The record from the source database is not migrated to the destination database.
During incremental migration, DTS does not keep the record in the destination cluster. The record from the source database overwrites the record in the destination database.
If the table schemas are inconsistent, only some columns of data may be migrated, or the migration may fail. Proceed with caution.
Source Objects
In the Source Objects box, click the objects to migrate, and then click
to move them to the Selected Objects box.NoteYou can select objects at the database or table level.
Selected Objects
To set the name of a migration object in the destination instance, or to specify the object that receives data in the destination instance, right-click the migration object in the Selected Objects box to make changes. For more information, see Object name mapping.
To remove a selected migration object, click the object in the Selected Objects box, and then click
to move it to the Source Objects box.
NoteIf you use the object name mapping feature, other objects that depend on the mapped object may fail to migrate.
To set a WHERE clause to filter data, right-click the table to migrate in the Selected Objects box and set the filter condition in the dialog box that appears. For more information about how to set the condition, see Set filter conditions.
To select the SQL operations for incremental migration, right-click the migration object in the Selected Objects box and select the desired SQL operations in the dialog box that appears.
Click Next: Advanced Settings to configure advanced parameters.
Configuration
Description
Dedicated Cluster for Task Scheduling
By default, DTS schedules tasks on a shared cluster. You do not need to select one. If you want more stable tasks, you can purchase a dedicated cluster to run DTS migration tasks.
Retry Time for Failed Connections
After the migration task starts, if the connection to the source or destination database fails, DTS reports an error and immediately starts continuous retry attempts. The default retry duration is 720 minutes. You can also customize the retry time within a range of 10 to 1440 minutes. We recommend that you set it to more than 30 minutes. If DTS reconnects to the source and destination databases within the set time, the migration task automatically resumes. Otherwise, the task fails.
NoteFor multiple DTS instances that share the same source or destination, the network retry time is determined by the setting of the last created task.
Because you are charged for the task during the connection retry period, we recommend that you customize the retry time based on your business needs, or release the DTS instance as soon as possible after the source and destination database instances are released.
Retry Time for Other Issues
After the migration task starts, if other non-connectivity issues occur in the source or destination database (such as a DDL or DML execution exception), DTS reports an error and immediately starts continuous retry attempts. The default retry duration is 10 minutes. You can also customize the retry time within a range of 1 to 1440 minutes. We recommend that you set it to more than 10 minutes. If the related operations succeed within the set retry time, the migration task automatically resumes. Otherwise, the task fails.
ImportantThe value of Retry Time for Other Issues must be less than the value of Retry Time for Failed Connections.
Enable Throttling for Full Data Migration
During the full migration phase, DTS consumes some read and write resources of the source and destination databases, which may increase the database load. As needed, you can choose whether to set speed limits for the full migration task. You can set Queries per second (QPS) to the source database, RPS of Full Data Migration, and Data migration speed for full migration (MB/s) to reduce the pressure on the destination database.
NoteThis configuration item is available only if you select Full Data Migration for Migration Types.
You can also adjust the full migration speed after the migration instance is running.
Enable Throttling for Incremental Data Migration
As needed, you can also choose whether to set speed limits for the incremental migration task. You can set RPS of Incremental Data Migration and Data migration speed for incremental migration (MB/s) to reduce the pressure on the destination database.
NoteThis configuration item is available only if you select Incremental Data Migration for Migration Types.
You can also adjust the incremental migration speed after the migration instance is running.
Whether to delete SQL operations on heartbeat tables of forward and reverse tasks
Choose whether to write heartbeat SQL information to the source database when the DTS instance is running.
Yes: Heartbeat SQL information is not written to the source database. This may cause the DTS instance to report a delay.
No: Writes heartbeat SQL information to the source database. This may interfere with features such as physical backup and cloning of the source database.
Environment Tag
You can select an environment tag to identify the instance. This is an optional step.
Monitoring and Alerting
Select whether to set alerts and receive alert notifications based on your business needs.
No: Does not set an alert.
Yes: Sets an alert. You must also set the alert threshold and alert contacts. The system sends an alert notification if the migration fails or the latency exceeds the threshold.
Click Next: Data Validation to configure a data validation task.
For more information about the data validation feature, see Configure data validation.
Save the task and run a precheck.
To view the parameters for configuring this instance when you call the API operation, move the pointer over the Next: Save Task Settings and Precheck button and click Preview OpenAPI parameters in the bubble.
If you do not need to view or have finished viewing the API parameters, click Next: Save Task Settings and Precheck at the bottom of the page.
NoteBefore the migration task starts, a precheck is performed. The task starts only after it passes the precheck.
If the precheck fails, click View Details next to the failed check item, fix the issue based on the prompt, and then run the precheck again.
If a warning is reported during the precheck:
For check items that cannot be ignored, click View Details next to the failed item, fix the issue based on the prompt, and then run the precheck again.
For check items that can be ignored and do not need to be fixed, you can click Confirm Alert Details, Ignore, OK, and Precheck Again to skip the alert item and run the precheck again. If you choose to shield an alert item, it may cause issues such as data inconsistency and pose risks to your business.
Purchase the instance.
When the Success Rate is 100%, click Next: Purchase Instance.
On the Purchase page, select the link specification for the data migration instance. For more information, see the following table.
Category
Parameter
Description
New Instance Class
Resource Group Settings
Select the resource group to which the instance belongs. The default value is default resource group. For more information, see What is Resource Management?
Instance Class
DTS provides migration specifications with different performance levels. The link specification affects the migration speed. You can select a specification based on your business scenario. For more information, see Data migration link specifications.
After the configuration is complete, read and select Data Transmission Service (Pay-as-you-go) Service Terms.
Click Buy and Start, and in the OK dialog box that appears, click OK.
You can view the progress of the migration instance on the Data Migration Tasks list page.
NoteIf the migration instance does not include an incremental migration task, it stops automatically. After the instance stops, its Status is Completed.
If the migration instance includes an incremental migration task, it does not stop automatically, and the incremental migration task continues to run. While the incremental migration task is running normally, the Status of the instance is Running.