All Products
Search
Document Center

Data Transmission Service:Migrate data from PolarDB-X 2.0 to ApsaraMQ for RocketMQ

Last Updated:Jun 09, 2026

This topic describes how to use Data Transmission Service (DTS) to migrate data from a PolarDB-X 2.0 instance to an ApsaraMQ for RocketMQ instance.

Note

This feature is in beta and available only to selected users.

Prerequisites

  • You must have a destination ApsaraMQ for RocketMQ instance (non-serverless). For more information, see Manage instances or Manage instances.

    Note

    See Data Synchronization Overview for the supported versions of the source and destination databases.

  • You must have a topic in the destination ApsaraMQ for RocketMQ instance to receive synchronized data. For more information, see Manage topics or Manage topics.

    Important

    For 4.x series instances, the Message Type of the topic must be set to Partitionally Ordered Message.

    For 5.x series instances, the Message Type of the topic must be set to Ordered Message.

Limitations

Type

Description

Source database limits

  • Synchronization objects:

    • Each table to be synchronized must have a primary key or a unique constraint. Otherwise, duplicate data may occur in the target database.

    • If a single task involves editing more than 5,000 tables (for example, by mapping column names), DTS may report an error upon submission. To avoid this, split the tables into multiple tasks or configure the task to synchronize the entire database.

  • Read-only instances of PolarDB-X 2.0 Enterprise Edition are not supported as the source database.

  • binlog:

    • You must enable binlog in the PolarDB-X 2.0 console and set the binlog_row_image parameter to full. Otherwise, the precheck fails, and the data synchronization task cannot start.

    • For an incremental synchronization task, DTS requires that the local binlog of the source database is retained for at least 24 hours. For a task that includes both full and incremental synchronization, DTS requires that the local binlog is retained for at least 7 days. After full synchronization completes, you can change the retention period to 24 hours or more. If a task fails because the binlog retention period is shorter than required, it may cause data inconsistency or loss. This issue is not covered by the DTS Service Level Agreement (SLA).

  • If a table name in the PolarDB-X 2.0 instance contains uppercase letters, only schema synchronization is supported for that table.

  • Synchronization of table groups (TABLEGROUP) and databases or tables with Locality attributes is not supported.

  • Synchronization of tables whose names are reserved keywords, such as select, is not supported.

  • For PolarDB-X 2.0 instances, synchronization of database partitions in DRDS mode is not supported.

  • Do not run DDL operations that change database or table schemas during schema synchronization or full synchronization. Otherwise, the synchronization task fails.

    Note

    During full synchronization, DTS queries the source database. This creates metadata locks that may block DDL operations on the source database.

Other limits

  • A serverless ApsaraMQ for RocketMQ instance cannot be used as the destination.

  • You can synchronize data only to specific topics in the destination ApsaraMQ for RocketMQ instance.

    • For ApsaraMQ for RocketMQ 4.x: The Message Type of the destination topic must be Partitionally Ordered Message.

      If the target Message Queue for RocketMQ instance is in a different Instance Region from the source database, DTS accesses the target Message Queue for RocketMQ instance by using its public endpoint, and public network traffic fees are incurred. You must ensure that public access is enabled for the target Message Queue for RocketMQ instance.

      Note
      • You can check the status of public access on the Basic Information tab of the Instance Details page in the ApsaraMQ for RocketMQ console.

      • For more information about the internet traffic fees for the destination ApsaraMQ for RocketMQ instance, see Internet traffic pricing details.

    • For ApsaraMQ for RocketMQ 5.x: The Message Type of the destination topic must be Ordered Message.

  • The destination ApsaraMQ for RocketMQ instance supports a maximum message body size of 4 MB.

  • Do not use tools like pt-online-schema-change to perform online DDL operations on the objects being synchronized in the source database. Otherwise, the synchronization task fails.

  • Changing the specifications of the target ApsaraMQ for RocketMQ instance (for example, by an upgrade or downgrade) can alter the message delivery order. This new order will persist.

  • During full data synchronization, DTS consumes read and write resources from both the source and destination databases, which may increase their load. We recommend evaluating the performance of both databases and synchronizing data during off-peak hours (for example, when the CPU utilization of both databases is below 30%).

  • During full data synchronization, concurrent INSERT operations cause table fragmentation in the destination database. After full data synchronization is complete, the destination tables will occupy more storage space than the source tables.

  • During data synchronization, do not use tools such as pt-online-schema-change to perform online DDL operations on the synchronization objects in the source database. Otherwise, the task will fail.

  • During data synchronization, if sources other than DTS write data to the destination database, data inconsistency may occur between the source and destination databases.

  • If a task fails, DTS support staff will attempt to restore it within eight hours. During restoration, they may restart the task or adjust its parameters.

    Note

    Only DTS task parameters are modified—not database parameters. Parameters that may be adjusted include those listed in Modify instance parameters.

Billing

Synchronization type

Link configuration fee

Full data migration

Free of charge.

Incremental data migration

This is a paid feature. For more information, see Billing overview.

Supported SQL operations

Operation type

SQL operations

DML

INSERT, UPDATE, DELETE

DDL

  • CREATE TABLE, ALTER TABLE, DROP TABLE, RENAME TABLE, TRUNCATE TABLE

    Important

    The RENAME TABLE operation may cause data inconsistency. For example, if the synchronization object is a single table and you rename it on the source instance during synchronization, the data of that table is not synchronized to the destination database. To avoid this issue, you can configure the task to synchronize the entire database that contains the table. Make sure that the database to which the table belongs both before and after the RENAME TABLE operation is included in the synchronization objects.

  • CREATE FUNCTION, DROP FUNCTION, CREATE TRIGGER, DROP TRIGGER

  • CREATE INDEX, DROP INDEX

Note

If the source database is a PolarDB-X 2.0 Enterprise Edition instance, CREATE FUNCTION and CREATE INDEX operations cannot be synchronized.

Database account permissions

Database

Required permissions

Creation and authorization

Source PolarDB-X 2.0 instance

REPLICATION SLAVE, REPLICATION CLIENT, and SELECT permissions on the objects to be synchronized.

Manage database accounts and Account permission issues during data synchronization.

Procedure

  1. Go to the data synchronization task list page in the destination region. You can do this in one of two ways.

    DTS console

    1. Log on to the DTS console.

    2. In the navigation pane on the left, click Data Synchronization.

    3. In the upper-left corner of the page, select the region where the synchronization instance is located.

    DMS console

    Note

    The actual steps may vary depending on the mode and layout of the DMS console. For more information, see Simple mode console and Customize DMS console layout and style.

    1. Log on to the DMS console.

    2. In the top menu bar, choose Data + AI > DTS (DTS) > Data Synchronization.

    3. To the right of Data Synchronization Tasks, select the region of the synchronization instance.

  2. After you complete the configuration, click Test Connectivity and Proceed at the bottom of the page.

    Note

    Ensure that the IP address blocks of the DTS service are added to the security settings of the source and destination databases, either automatically or manually, to allow access from DTS servers. For more information, see Add the IP address whitelist of DTS servers.

  3. Configure the task objects.

    1. On the Configure Objects page, specify the objects to synchronize.

      Parameter

      Description

      Migration Types

      By default, Incremental Data Synchronization is selected, which supports only Full Data Synchronization. Schema Synchronization is not supported. After the precheck is complete, DTS initializes the synchronization objects in the destination cluster with data from the source instance. This initial data serves as the baseline for subsequent incremental synchronization.

      Note

      When the target database is an ApsaraMQ for RocketMQ instance, Schema Migration is not supported.

      Processing Mode of Conflicting Tables

      • Precheck and Report Errors: Checks for tables with the same names in the destination database. If any tables with the same names are found, an error is reported during the precheck and the data synchronization task does not start. Otherwise, the precheck is successful.

        Note

        If you cannot delete or rename the table with the same name in the destination database, you can map it to a different name in the destination. For more information, see Object name mapping.

      • Ignore Errors and Proceed: Skips the check for tables with the same name in the destination database.

        Warning

        Selecting Ignore Errors and Proceed may cause data inconsistency and put your business at risk. For example:

        • If the table schemas are consistent and a record in the destination database has the same primary key or unique key value as a record in the source database:

          • During full data synchronization, DTS retains the destination record and skips the source record.

          • During incremental synchronization, DTS overwrites the destination record with the source record.

        • If the table schemas are inconsistent, data initialization may fail. This can result in only partial data synchronization or a complete synchronization failure. Use with caution.

      Format of the data delivered to RocketMQ.

      Select the storage format for writing data to the destination topic based on your requirements. For more information, see Data storage formats in message queues.

      Rules of the ordered messages delivered to RocketMQ.

      Select the message ordering rule for writing data to the destination topic. For more information, see Message ordering rules for Message Queue for RocketMQ.

      Name of DTS producer group

      You can specify a custom name for the producer group (ProducerGroup) that sends messages to the destination topic.

      Note

      The default value is dts-producer-group.

      Limits of RocketMQ messaging transactions per second (TPS)

      You can set a limit on the messaging transactions per second (TPS) for writing data to the destination topic. For more information about messaging TPS, see Calculation specifications.

      Important
      • The value must be less than or equal to the maximum TPS of the Message Queue for RocketMQ instance. For more information, see Instance specifications.

      • While the synchronization task is running, the actual messaging TPS of the Message Queue for RocketMQ instance may fluctuate slightly around the specified value.

      Whether to filter large size of records.

      Specify whether to filter out messages larger than 4 MB before writing them to the destination topic.

      Important

      If you select No, the synchronization task fails if it attempts to write a message larger than 4 MB to the destination topic.

      Capitalization of Object Names in Destination Instance

      Configure the case-sensitivity policy for database, table, and column names in the destination instance. By default, the DTS default policy is selected. You can also choose to use the default policy of the source or destination database. For more information, see Case policy for destination object names.

      Source Objects

      In the Source Objects box, click the objects, and then click 向右 to move them to the Selected Objects box.

      Note

      You can select objects at the database or table level.

      Selected Objects

      No additional configuration is required for this example. You can use the mapping feature to set the topic name in the target ApsaraMQ for RocketMQ instance, set filter conditions, select SQL operations to synchronize, and set a Partition Key. For more information, see Mapping information.

    2. Click Next: Advanced Settings.

      Parameter

      Description

      Dedicated Cluster for Task Scheduling

      By default, DTS uses a shared cluster for tasks, so you do not need to make a selection. For greater task stability, you can purchase a dedicated cluster to run the DTS synchronization task. For more information, see What is a DTS dedicated cluster?.

      Retry Time for Failed Connections

      If the connection to the source or destination database fails after the synchronization task starts, DTS reports an error and immediately begins to retry the connection. The default retry duration is 720 minutes. You can customize the retry time to a value from 10 to 1,440 minutes. We recommend a duration of 30 minutes or more. If the connection is restored within this period, the task resumes automatically. Otherwise, the task fails.

      Note
      • If multiple DTS instances (e.g., Instance A and B) share a source or destination, DTS uses the shortest configured retry duration (e.g., 30 minutes for A, 60 for B, so 30 minutes is used) for all instances.

      • DTS charges for task runtime during connection retries. Set a custom duration based on your business needs, or release the DTS instance promptly after you release the source/destination instances.

      Retry Time for Other Issues

      If a non-connection issue (e.g., a DDL or DML execution error) occurs, DTS reports an error and immediately retries the operation. The default retry duration is 10 minutes. You can also customize the retry time to a value from 1 to 1,440 minutes. We recommend a duration of 10 minutes or more. If the related operations succeed within the set retry time, the synchronization task automatically resumes. Otherwise, the task fails.

      Important

      The value of Retry Time for Other Issues must be less than that of Retry Time for Failed Connections.

      Enable Throttling for Full Data Migration

      During full data synchronization, DTS consumes read and write resources from the source and destination databases, which can increase their load. To mitigate pressure on the destination database, you can limit the migration rate by setting Queries per second (QPS) to the source database, RPS of Full Data Migration, and Data migration speed for full migration (MB/s).

      Note

      Enable Throttling for Incremental Data Migration

      You can also limit the incremental synchronization rate to reduce pressure on the destination database by setting RPS of Incremental Data Synchronization and Data synchronization speed for incremental synchronization (MB/s).

      Whether to delete SQL operations on heartbeat tables of forward and reverse tasks

      Choose whether DTS writes heartbeat SQL information to the source database while the instance is running.

      • Yes: Does not write heartbeat SQL information to the source database. The DTS instance may display latency.

      • No: Writes heartbeat SQL information to the source database. This may interfere with source database operations like physical backups and cloning.

      Environment Tag

      You can select an environment tag to identify the instance. No selection is required for this example.

      Configure ETL

      Choose whether to enable the extract, transform, and load (ETL) feature. For more information, see What is ETL? Valid values:

      Monitoring and Alerting

      Choose whether to set up alerts. If the synchronization fails or the latency exceeds the specified threshold, DTS sends a notification to the alert contacts.

  4. Save the task and perform a precheck.

    • To view the parameters for configuring this instance via an API operation, hover over the Next: Save Task Settings and Precheck button and click Preview OpenAPI parameters in the tooltip.

    • If you have finished viewing the API parameters, click Next: Save Task Settings and Precheck at the bottom of the page.

    Note
    • Before a synchronization task starts, DTS performs a precheck. You can start the task only if the precheck passes.

    • If the precheck fails, click View Details next to the failed item, fix the issue as prompted, and then rerun the precheck.

    • If the precheck generates warnings:

      • For non-ignorable warning, click View Details next to the item, fix the issue as prompted, and run the precheck again.

      • For ignorable warnings, you can bypass them by clicking Confirm Alert Details, then Ignore, and then OK. Finally, click Precheck Again to skip the warning and run the precheck again. Ignoring precheck warnings may lead to data inconsistencies and other business risks. Proceed with caution.

  5. Purchase the instance.

    1. When the Success Rate reaches 100%, click Next: Purchase Instance.

    2. On the Purchase page, select the billing method and link specifications for the data synchronization instance. For more information, see the following table.

      Category

      Parameter

      Description

      New Instance Class

      Billing Method

      • Subscription: You pay upfront for a specific duration. This is cost-effective for long-term, continuous tasks.

      • Pay-as-you-go: You are billed hourly for actual usage. This is ideal for short-term or test tasks, as you can release the instance at any time to save costs.

      Resource Group Settings

      The resource group to which the instance belongs. The default is default resource group. For more information, see What is Resource Management?.

      Instance Class

      DTS offers synchronization specifications at different performance levels that affect the synchronization rate. Select a specification based on your business requirements. For more information, see Data synchronization link specifications.

      Subscription Duration

      In subscription mode, select the duration and quantity of the instance. Monthly options range from 1 to 9 months. Yearly options include 1, 2, 3, or 5 years.

      Note

      This option appears only when the billing method is Subscription.

    3. Read and select the checkbox for Data Transmission Service (Pay-as-you-go) Service Terms.

    4. Click Buy and Start, and then click OK in the OK dialog box.

      You can monitor the task progress on the data synchronization page.

Mapping information

  1. In the Selected Objects list, hover the pointer over the destination topic name.

  2. Click Edit next to the destination topic name.

  3. In the dialog box, configure the mapping information.

    Note
    • If mapping is configured at both the database level and table level, the table-level mapping takes precedence.

    • For database-level mapping, use the Edit Schema dialog box. For table-level mapping, use the Edit Table dialog box.

    Database level

    Parameter

    Description

    Schema Name

    The destination topic to which the synchronized data is written. By default, this is the Topic you selected for the Destination Database in the Configurations for Source and Destination Databases step.

    Important
    • The specified topic name must exist in the destination Message Queue for RocketMQ instance. Otherwise, the data synchronization task fails.

    • If you change the Schema Name, data is written to the specified topic.

    Select DDL and DML Operations to Be Synchronized

    Select the SQL operations for incremental synchronization.

    Table level

    Parameter

    Description

    Table Name

    The destination topic to which the synchronized data is written. By default, this is the Topic you selected for the Destination Database in the Configurations for Source and Destination Databases step.

    Important
    • The specified topic name must exist in the destination Message Queue for RocketMQ instance. Otherwise, the data synchronization task fails.

    • If you change the Table Name, data is written to the specified topic.

    Filter Conditions

    For more information, see Set Filter Conditions.

    Select DDL and DML Operations to Be Synchronized

    Select the SQL operations for incremental synchronization.

    Partition Key

    If you set Rules of the ordered messages delivered to RocketMQ. to Deliver data based on hash values of a specified column., you can specify one or more columns as the partition key. DTS then delivers rows to different partitions of the destination topic based on the hash value calculated from the key.

  4. Click OK.