All Products
Search
Document Center

Data Transmission Service:Migrate data from a PolarDB for MySQL cluster to a DataHub project

Last Updated:Mar 01, 2026

Data Transmission Service (DTS) replicates table schemas and streams incremental changes from a PolarDB for MySQL cluster to a DataHub project for real-time extract, transform, and load (ETL) pipelines and downstream analytics.

Prerequisites

Before you begin, make sure that you have:

  • Activated DataHub and created a project to receive the migrated data. For more information, see Get started with DataHub and Manage projects

  • Verified that the available storage space of the destination DataHub project exceeds the total data size in the source PolarDB for MySQL cluster

Migration types and SQL operations

Migration types

  • Schema migration: DTS migrates the schemas of selected objects from the source database to the destination database.

  • Incremental data migration: After full data migration completes, DTS continuously migrates incremental data from the source to the destination. This keeps data in sync without interrupting application services.

For this migration path, select Schema Migration or Incremental Data Migration based on your business requirements.

SQL operations for incremental migration

Operation typeSQL statements
Data Manipulation Language (DML)INSERT, UPDATE, and DELETE
DDLALTER TABLE and TRUNCATE TABLE

Billing

Migration typeInstance configuration feeInternet traffic fee
Schema migration and full data migrationFree of chargeCharged only when data is migrated from Alibaba Cloud over the Internet. For more information, see Billing overview.
Incremental data migrationCharged. For more information, see Billing overview.

Required permissions

DatabaseRequired permissionReferences
PolarDB for MySQL clusterRead permissions on the objects to be migratedCreate and manage a database account

Limitations

DTS does not migrate foreign keys from the source database. As a result, cascade and delete operations in the source database are not migrated to the destination database.
CategoryLimitation
Source databaseThe server that hosts the source database must have sufficient outbound bandwidth. Insufficient bandwidth reduces the migration speed.
Source databaseTables to be migrated must have PRIMARY KEY or UNIQUE constraints, and all fields must be unique. Otherwise, the destination database may contain duplicate records.
Source databaseWhen you select tables as migration objects and edit them (for example, rename tables or columns), a single task supports up to 1,000 tables. To migrate more than 1,000 tables, create multiple tasks or migrate the entire database.
Source databaseFor incremental data migration, enable binary logging and set the loose_polar_log_bin parameter to on. Otherwise, the precheck returns errors and the task cannot start. For more information, see Enable binary logging and Modify parameters.
Source databaseEnabling binary logging for a PolarDB for MySQL cluster incurs storage charges for the space that binary logs occupy.
Source databaseBinary logs of the source database must be retained for more than 24 hours. If DTS cannot obtain binary logs, the task may fail. In exceptional cases, data inconsistency or loss may occur. If you do not meet the retention requirement, the Service Level Agreement (SLA) of DTS does not guarantee service reliability or performance.
Source databaseDo not perform Data Definition Language (DDL) operations that change database or table schemas during schema migration. DDL operations cause the task to fail.
Source databaseRead-only nodes of the source PolarDB for MySQL cluster cannot be migrated.
OtherOnly tables are supported as migration objects. If a column is added to a source table during migration, the new column is not migrated to the destination DataHub project.
OtherDuring full data migration, DTS consumes read and write resources of both the source and destination databases. This may increase database server loads. Migrate data during off-peak hours.
OtherDTS uses the ROUND(COLUMN, PRECISION) function to retrieve values from FLOAT and DOUBLE columns. If you do not specify a precision, DTS uses 38 digits for FLOAT and 308 digits for DOUBLE. Verify that these precision settings meet your business requirements.
OtherDTS attempts to resume failed tasks within the last seven days. Before you switch workloads to the destination database, stop or release the migration task. You can also run the REVOKE statement to remove write permissions from the DTS accounts on the destination database. Otherwise, resumed tasks may overwrite data in the destination database.
OtherDo not use tools such as pt-online-schema-change to perform DDL operations on objects during migration. DDL operations from external tools may cause the task to fail.
Usage noteDTS periodically executes `CREATE DATABASE IF NOT EXISTS test ` in the source database to advance the binary log file position.

Procedure

Step 1: Open the data migration page

  1. Log on to the Data Management (DMS) console.

  2. In the top navigation bar, move the pointer over DTS.

  3. Choose DTS (DTS) > Data Migration.

    The actual operations may vary based on the mode and layout of the DMS console. For more information, see Simple mode and Customize the layout and style of the DMS console. You can also go to the Data Migration page of the new DTS console directly.
  4. From the drop-down list on the right side of Data Migration Tasks, select the region where your data migration instance resides.

    In the new DTS console, select the region in the upper-left corner instead.

Step 2: Configure source and destination databases

  1. Click Create Task.

  2. On the Create Data Migration Task page, configure the source and destination databases.

    Source Database

    ParameterDescription
    Task NameDTS generates a name automatically. Specify a descriptive name to identify the task. The name does not need to be unique.
    Select DMS Database InstanceOptional. Select an existing instance to auto-populate database parameters. If you do not select one, configure the parameters manually.
    Database TypeSelect PolarDB for MySQL.
    Connection TypeSelect Alibaba Cloud Instance.
    Instance RegionSelect the region where the source PolarDB for MySQL instance resides.
    Cross-accountSelect No if the source and destination belong to the same Alibaba Cloud account.
    PolarDB Cluster IDSelect the ID of the source PolarDB for MySQL cluster.
    Database AccountEnter the database account of the source PolarDB for MySQL cluster. The account must have read permissions on the objects to be migrated.
    Database PasswordEnter the password for the database account.

    Destination Database

    ParameterDescription
    Select DMS Database InstanceOptional. Select an existing instance to auto-populate database parameters. If you do not select one, configure the parameters manually.
    Database TypeSelect DataHub.
    Connection TypeSelect Alibaba Cloud Instance.
    Instance RegionSelect the region where the destination DataHub project resides.
    ProjectSelect the ID of the destination DataHub project.
  3. In the lower part of the page, click Test Connectivity and Proceed. DTS automatically adds the CIDR blocks of DTS servers to the IP address whitelist of Alibaba Cloud database instances, or to the security group rules of Elastic Compute Service (ECS) instances that host self-managed databases. For self-managed databases in a data center or from a third-party cloud provider, manually add the CIDR blocks of DTS servers to the database IP address whitelist. For more information, see CIDR blocks of DTS servers.

    Warning

    Adding public CIDR blocks of DTS servers to a database whitelist or ECS security group introduces security risks. Take preventive measures such as strengthening username and password security, restricting exposed ports, authenticating API calls, regularly auditing whitelist or security group rules, forbidding unauthorized CIDR blocks, and connecting to DTS through Express Connect, VPN Gateway, or Smart Access Gateway.

Step 3: Configure migration objects and settings

  1. Configure the objects to be migrated and the migration settings.

    ParameterDescription
    Migration TypesSelect Schema Migration or Incremental Data Migration based on your requirements.
    Note

    If you do not select Incremental Data Migration, do not write data to the source database during migration to maintain data consistency.

    Processing Mode of Conflicting Tables
    Naming Rules of Additional ColumnsAfter DTS migrates data to DataHub, it adds additional columns to the destination topic. If column names conflict with existing columns, the migration fails. Select New Rule or Previous Rule based on your requirements.
    Warning

    Before you configure this parameter, check for name conflicts between additional columns and existing columns. For more information, see Naming rules for additional columns.

    Capitalization of Object Names in Destination InstanceSet the capitalization rule for database, table, and column names. The default is DTS default policy. For more information, see Specify the capitalization of object names in the destination instance.
    Source ObjectsSelect objects from the Source Objects section and click the right arrow icon to add them to Selected Objects.
    Note

    Select tables or databases as migration objects. Selecting tables excludes views, triggers, and stored procedures.

    Selected ObjectsTo rename an object, right-click it in the Selected Objects section. For more information, see Map the name of a single object. To rename multiple objects at a time, click Batch Edit. For more information, see Map multiple object names at a time.
    Note

    Renaming objects may cause dependent objects to fail to migrate. To filter data, right-click an object in Selected Objects and specify WHERE conditions. For more information, see Specify filter conditions. To select specific SQL operations for a database or table, right-click the object in Selected Objects and choose the operations to migrate.

  2. Click Next: Advanced Settings.

    ParameterDescription
    Monitoring and AlertingConfigure alerting for the task. When enabled, alert contacts receive notifications if the task fails or migration latency exceeds the specified threshold. For more information, see Configure monitoring and alerting when you create a DTS task.
    Configure ETLEnable or disable the ETL feature. When enabled, enter data processing statements in the code editor. For more information, see What is ETL? and Configure ETL in a data migration or data synchronization task.

Step 4: Run the precheck and purchase the instance

  1. Click Next: Save Task Settings and Precheck. You can move the pointer over Next: Save Task Settings and Precheck and click Preview OpenAPI parameters to view the API parameters for this task.

    • If a precheck item fails, click View Details next to the item. Analyze the cause, fix the issue, and run the precheck again.

    • If a precheck item triggers an alert that can be ignored, click Confirm Alert Details, then click Ignore in the View Details dialog box, and click OK. Then click Precheck Again. Ignoring alert items may cause data inconsistency and business risks.

    DTS runs a precheck before the task starts. The task starts only after the precheck succeeds.
  2. Wait until Success Rate reaches 100%, then click Next: Purchase Instance.

  3. On the Purchase Instance page, configure the instance settings.

    ParameterDescription
    Resource GroupThe resource group for the data migration instance. The default value is default resource group. For more information, see What is Resource Management?
    Instance ClassSelect an instance class based on your migration speed requirements. For more information, see Instance classes of data migration instances.
  4. Read and select the Data Transmission Service (Pay-as-you-go) Service Terms check box.

  5. Click Buy and Start. In the confirmation message, click OK. View the migration progress on the Data Migration page.