All Products
Search
Document Center

Tablestore:Synchronize data from PolarDB-X 2.0 to Tablestore

Last Updated:Sep 22, 2026

Data Transmission Service (DTS) lets you synchronize data from PolarDB-X 2.0 to Tablestore.

Prerequisites

  • A Tablestore instance is created. For more information, see Create an instance.

  • The AccessKey ID and AccessKey secret of the Alibaba Cloud account that owns the Tablestore instance are obtained. For more information, see Create an AccessKey.

Precautions

Type

Description

Source database limits

  • The tables to be synchronized must have primary keys or UNIQUE constraints, and the fields must be unique. Otherwise, duplicate data may appear in the destination database.

  • If you synchronize data at the table level and need to edit the objects, such as mapping table or column names, do not include more than 5,000 tables in a single synchronization task. We recommend that you split the tables into multiple tasks or configure a task to synchronize the entire database. Otherwise, a request error may occur after you submit the task.

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

  • PolarDB-X 2.0 has binary logging (binlog) enabled by default. Make sure that the binlog_row_image parameter is set to full. For more information about how to view the parameter, see Parameters setting. Otherwise, an error is reported during the precheck and the data synchronization task cannot start.

  • During schema synchronization and full data synchronization, do not perform DDL operations to change the schema of the database or tables. Otherwise, the data synchronization task fails.

Other limits

  • Before you synchronize data, evaluate the performance of the source and destination databases. We recommend that you synchronize data during off-peak hours. This is because full data synchronization consumes read and write resources on the source and destination databases, which may increase the database workload.

  • Full data synchronization concurrently runs INSERT operations. This causes table fragmentation in the destination database. As a result, the tablespace of the destination instance is larger than that of the source instance after full data synchronization is complete.

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

  • Data from the source tables can be synchronized only to data tables in Tablestore.

  • The number of tables to be synchronized cannot exceed the limit of the Tablestore instance, which is 64. Otherwise, the synchronization task reports an error. To synchronize more than 64 tables, contact Tablestore helpdesk to increase the table limit for the destination Tablestore instance.

  • The names of the tables or columns to be synchronized must follow the naming conventions of Tablestore:

    • A table or column name can contain uppercase letters, lowercase letters, digits, and underscores (_). It must start with a letter or an underscore.

    • A table or column name must be 1 to 255 characters in length.

  • 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.

SQL operations that can be incrementally synchronized

Operation type SQL statement
DML INSERT, UPDATE, DELETE

Procedure

  1. Go to the list of synchronization tasks.

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

    2. Click Integration & Development in the top menu bar.

    3. In the left navigation pane, choose Data Transmission (DTS) > Data Synchronization.

    4. To the right of Sync Tasks, select the region where the data synchronization instance is located.

    Note
  2. Click Create Task to open the task configuration page.

    1. Optional: In the upper-right corner, click New Configuration Page.

      Note
      • If the button in the upper-right corner of the new configuration page is Back to Previous Version, you can skip this step.

      • Some parameters on the new configuration page are different from those on the old configuration page. We recommend that you use the new configuration page.

    2. 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 an existing DMS database instance. (Optional. If you have not registered a DMS database instance, ignore this option and configure database settings in the section below.)

      Choose whether to use an existing instance as needed.

      • If you use an existing instance, the database information is automatically filled in. You do not need to enter it again.

      • If you do not use an existing instance, enter the database information below.

      Database Type

      Select PolarDB-X 2.0.

      Access Method

      Select Alibaba Cloud Instance.

      Instance Region

      Select the region where the source PolarDB-X 2.0 instance is located.

      Replicate Data Across Alibaba Cloud Accounts

      This example shows how to synchronize data within the same Alibaba Cloud account. Select No. For information about cross-account scenarios, see Configure a task for cross-account data synchronization.

      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. The account must have the REPLICATION SLAVE, REPLICATION CLIENT, and SELECT permissions on the objects to be synchronized.

      Note

      For more information about how to grant permissions, see Manage database accounts and Account permission issues during data synchronization.

      Database Password

      Enter the password for the specified database account.

      Destination Database

      Select an existing DMS database instance. (Optional. If you have not registered a DMS database instance, ignore this option and configure database settings in the section below.)

      Choose whether to use an existing instance as needed.

      • If you use an existing instance, the database information is automatically filled in. You do not need to enter it again.

      • If you do not use an existing instance, enter the database information below.

      Database Type

      Select Tablestore.

      Access Method

      Select Alibaba Cloud Instance.

      Instance Region

      Select the region where the destination Tablestore instance resides.

      Instance ID

      Select the name of the destination Tablestore instance.

      AccessKey ID of Alibaba Cloud Account

      Enter the AccessKey ID of the Alibaba Cloud account that owns the Tablestore instance. The AccessKey ID is used to identify the user.

      Important

      If you enter the AccessKey ID of a Resource Access Management (RAM) user, you must grant the AliyunOTSFullAccess permission to the RAM user. This permission allows the user to manage Tablestore. For more information, see Grant permissions to a RAM user using a RAM policy.

      AccessKey Secret of Alibaba Cloud Account

      Enter the AccessKey secret of the Alibaba Cloud account that owns the Tablestore instance. The AccessKey secret is used to verify the user's identity.

    3. After completing the configuration, click Test Connection and Proceed at the bottom of the page.

      If the source or destination database is an Alibaba Cloud database instance, such as an RDS for MySQL instance or an ApsaraDB for MongoDB instance, DTS automatically adds the IP address of the DTS service for the corresponding region to the whitelist of the Alibaba Cloud database instance. If the source or destination database is a self-managed database on an ECS instance, DTS automatically adds the IP address of the DTS service for the corresponding region to the security rules of the ECS instance. You must also ensure that the self-managed database does not restrict access from the ECS instance. If the database is deployed in a cluster on multiple ECS instances, you must manually add the IP address of the DTS service for the corresponding region to the security rules of each of the other ECS instances. If the source or destination database is a self-managed database in an IDC or a database from another cloud provider, you must manually add the IP address of the DTS service for the corresponding region to allow access from the DTS servers. For more information about the IP addresses of the DTS service, see IP address blocks of DTS servers.

      Warning

      Adding the public IP address blocks of the DTS service, either automatically or manually, may pose security risks. Using this product, you acknowledge that you understand and accept the potential security risks and that you must implement basic security measures. These measures include, but are not limited to, strengthening password security, limiting the ports open to each CIDR block, using authentication for internal API calls, and regularly checking and restricting unnecessary CIDR blocks. Alternatively, you can connect through a private network using a leased line, VPN Gateway, or Smart Access Gateway.

  3. Configure the task objects.

    1. On the Configure Objects page, you can configure the objects to synchronize.

      Configuration

      Description

      Synchronization Types

      DTS always selects Incremental Data Synchronization. By default, you must also select Schema Synchronization and Full Data Synchronization. After the precheck, DTS initializes the destination cluster with the full data of the selected source objects, which serves as the baseline for subsequent incremental synchronization.

      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.

      Operation Types

      Select the operation types to synchronize based on your business needs. By default, all operation types are selected.

      Processing Policy of Dirty Data

      Select a policy to handle errors that occur when writing data. Valid values:

      • Skip

      • Block

      Data Write Mode

      Select a data write mode. Valid values:

      • Overwrite Row: Uses UpdateRowChange to overwrite data at the row level.

      • Update Row: Uses PutRowChange to update data at the row level.

      Batch Write Mode

      The API operation that is called for batch writes. Valid values:

      • BulkImportRequest: Offline write.

      • BatchWriteRowRequest: Batch write.

      Note

      We recommend that you select BulkImportRequest for higher read and write efficiency and lower billing for the Tablestore instance.

      More

      If required, click More to configure the following parameters:

      • Queue Size: The queue length of the data write process for the Tablestore instance.

      • Thread Quantity: The number of callback handler threads for the data write process of the Tablestore instance.

      • Concurrency: The concurrent request limit for the Tablestore instance.

      • Buckets: The number of concurrent buckets for sequential writes of incremental data. A larger value can improve concurrent write performance.

        Note

        The value of Buckets must be less than or equal to the value of Concurrency.

      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 to synchronize at the database or table level. If you select tables, other objects such as views, triggers, and stored procedures are not synchronized to the destination database.

      • You can synchronize tables from only one database. This means you can select only one database, or multiple tables from the same database.

      Selected Objects

      • To rename a single object in the destination instance, right-click the object in the Selected Objects box. For more information, see Map a single object name.

      • To rename multiple objects in bulk, click Batch Edit in the upper-right corner of the Selected Objects box. For more information, see Map multiple object names in bulk.

      Note
      • Database name mapping is not supported. You can map table and column names only when you select objects to synchronize at the table level. If you use the mapping feature, other objects that depend on the mapped object may fail to be synchronized.

      • When you use the column name mapping feature, you can change the type of the corresponding column in the destination Tablestore instance.

      • To set a WHERE clause to filter data, right-click the table to be synchronized 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 a filter condition.

    2. Click Next: Advanced Settings to configure advanced settings.

      Configuration

      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 Synchronization

      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 Synchronization

      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).

      Environment Tag

      If required, you can select an environment tag to identify the instance. In this example, no tag is selected.

      Configure ETL

      The extract, transform, and load (ETL) feature is not supported. Select No.

      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.

      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.

    3. Click Next: Configure Database and Table Fields, and then click OK in the Note dialog box.

      By default, DTS sets the primary key of the source table as the Primary Key Column. You can set Definition Status to All to modify the primary key.

      Note

      You can select multiple columns for the Primary Key Column to form a composite primary key.

  4. Click Next: Save Task and Precheck at the bottom of the page.

    • To view the parameters for configuring this instance by calling an API operation, move the mouse pointer over the Next: Save Task Settings and Precheck button and click Preview OpenAPI parameters in the bubble that appears.

    • If you do not need to view the API parameters or have finished viewing them, click Next: Save Task Settings and Precheck at the bottom of the page.

    Note
    • A precheck is performed before the synchronization job starts. The job can start only after the precheck is passed.

    • If the precheck fails, click View Details next to the failed check item. Fix the issue based on the cause and 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 check item. Fix the issue based on the cause and run the precheck again.

      • For check items that can be ignored, click Click to Confirm Alert Details, Confirm Ignore, OK, and Rerun Precheck to skip the warning and run the precheck again. If you choose to ignore a warning, it may cause issues such as data inconsistency and pose a risk to your business.

  5. When the Precheck Pass Rate reaches 100%, click Next: Purchase.

  6. Purchase the instance.

    1. 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.

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

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

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

  7. Verify the result.

    1. Log on to the Tablestore console.

    2. In the top navigation bar, select a resource group and a region.

    3. On the Overview page, click the instance name or click Instance Management in the Actions column of the instance.

    4. On the Instance Details tab, click Data Table List to query the synchronized table data.