All Products
Search
Document Center

AnalyticDB:Synchronize data from an ApsaraDB RDS for MySQL instance to an AnalyticDB for PostgreSQL instance

Last Updated:Mar 28, 2026

Use Data Transmission Service (DTS) to continuously synchronize data from ApsaraDB RDS for MySQL to AnalyticDB for PostgreSQL. DTS supports an initial full load followed by ongoing incremental change capture (CDC), making it suitable for building real-time analytics pipelines on live OLTP data.

How it works

The synchronization runs in two sequential phases:

  1. Schema and full data synchronizationDefine constraintsDefine table distribution — DTS copies the table schemas and all existing rows from MySQL to AnalyticDB for PostgreSQL. This phase is free of charge.

  2. Incremental data synchronization — DTS reads the MySQL binlog and continuously applies INSERT, UPDATE, DELETE, and ADD COLUMN operations to the destination. This phase is billed.

Prerequisites

Before you begin, make sure that:

Limits

ConstraintDetails
Synchronization objectsOnly tables can be selected. Databases and schemas cannot be selected directly.
Unsupported data typesBIT, VARBIT, GEOMETRY, ARRAY, UUID, TSQUERY, TSVECTOR, TXID_SNAPSHOT, POINT
Prefix indexesNot synchronized. If source tables have prefix indexes, synchronization may fail.
DDL toolsDo not use gh-ost or pt-online-schema-change for DDL operations while a synchronization task is running.
CREATE TABLENot supported. To include a new table, add it to the selected objects manually. For more information, see Add an object to a data synchronization task.

Supported synchronization topologies

  • One-way one-to-one synchronization

  • One-way one-to-many synchronization

  • One-way many-to-one synchronization

Term mappings

MySQLAnalyticDB for PostgreSQL
DatabaseSchema
TableTable

Set up a synchronization task

Step 1: Purchase a DTS instance

Purchase a DTS instance. On the buy page, set the following:

  • Source Instance: MySQL

  • Target Instance: AnalyticDB for PostgreSQL

  • Synchronization Topology: One-Way Synchronization

Step 2: Configure the synchronization channel

  1. Log on to the DTS console.

    DTS console
  2. In the left-side navigation pane, click Data Synchronization.

  3. At the top of the Synchronization Tasks page, select the region where the destination instance resides.

  4. Find the instance, then click Configure Synchronization Channel in the Actions column.

  5. Configure the source and destination instances.

    Source instance details

    ParameterDescription
    Synchronization task nameAuto-generated by DTS. Specify a descriptive name to identify the task. The name does not need to be unique.
    Instance typeSelect RDS Instance.
    Instance regionPre-filled from the buy page. Cannot be changed.
    RDS instance IDThe ID of the source ApsaraDB RDS for MySQL instance.
    Database accountThe database account of the source instance.
    Important

    Not required for MySQL 5.5 or MySQL 5.6.

    Database passwordThe password of the database account.
    EncryptionSelect Non-encryptedConfigure SSL encryption on an ApsaraDB RDS for MySQL instance
    Note The Encryption parameter is available only within regions in the Chinese mainland and the China (Hong Kong) region.
    or SSL-encrypted. To use SSL-encrypted, enable SSL encryption on the RDS instance first. For more information, see Configure SSL encryption on an ApsaraDB RDS for MySQL instance.
    Note

    The Encryption parameter is available only in the Chinese mainland and the China (Hong Kong) region.

    Destination instance details

    ParameterDescription
    Instance typeSet to AnalyticDB for PostgreSQL. Cannot be changed.
    Instance regionPre-filled from the buy page. Cannot be changed.
    Instance IDThe ID of the destination AnalyticDB for PostgreSQL instance.
    Database nameThe name of the destination database.
    Database accountThe initial account of the AnalyticDB for PostgreSQL instance, or an account with the RDS_SUPERUSER permission. For more information, see Create a database account and Manage users and permissions.
    Database passwordThe password of the database account.

    Configure the source and destination instances

  6. In the lower-right corner, click Set Whitelist and Next. DTS automatically adds its server IP addresses to the whitelist of Alibaba Cloud database instances (such as ApsaraDB RDS or ApsaraDB for MongoDB). For self-managed databases on Elastic Compute Service (ECS) instances, DTS automatically adds its IP addresses to the ECS security group rules — make sure the ECS instance can access the database. If the self-managed database is hosted on multiple ECS instances, you must manually add the CIDR blocks of DTS servers to the security group rules of each ECS instance. For self-managed databases in a data center or hosted by a third-party cloud provider, manually add the DTS server CIDR blocks to the database IP address whitelist. For more information, see Add the CIDR blocks of DTS servers.

    Warning

    Adding DTS CIDR blocks to your whitelist or security group rules introduces potential security risks. Before proceeding, take preventive measures such as using strong credentials, restricting exposed ports, authenticating API calls, reviewing whitelist rules regularly, and connecting through Express Connect, VPN Gateway, or Smart Access Gateway where possible.

  7. Select the synchronization policy and objects.

    ParameterDescription
    Initial synchronizationSelect both Initial Schema Synchronization and Initial Full Data Synchronization. DTS synchronizes schemas and data from the source before incremental synchronization begins.
    Processing mode of conflicting tablesClear target table: Skips the Schema Name Conflict item during the precheck. Clears destination table data before the full sync. Use this to start with a clean slate, such as after testing. Ignore: Skips the Schema Name Conflict item during the precheck. Appends incoming data to existing destination data. Use this to merge data from multiple source tables into one destination table.
    Synchronization typeSelect the operation types to synchronize: Insert, Update, Delete, AlterTable.
    Select objects to synchronizeIn the Available section, select one or more tables, then click the arrow icon to move them to the Selected section. Use the object name mapping feature to rename synchronized columns. For more information, see Rename an object to be synchronized.
    Rename databases and tablesUse the object name mapping feature to rename synchronized objects in the destination instance. For more information, see Object name mapping.
    Replicate temporary tables when DMS performs DDL operationsIf you use Data Management (DMS) for online DDL operations on the source, choose whether to synchronize the temporary tables DMS generates. Yes: Synchronizes temporary table data. Large DDL operations may cause synchronization delays. No: Synchronizes only the original DDL changes, not the temporary tables. Destination tables may be locked temporarily.
    Retry time for failed connectionsDefault: 720 minutes (12 hours). If DTS reconnects within this window, the task resumes automatically. Otherwise, the task fails. Adjust this value based on your needs.
    Note

    You are charged for the DTS instance during retry periods. Release the instance promptly if the source or destination is no longer available.

    Synchronize data from MySQL to AnalyticDB for PostgreSQL

  8. If you selected Initial Schema Synchronization, specify the primary key column and distribution column for the tables to be synchronized to AnalyticDB for PostgreSQL. For more information, see Define constraints and Define table distribution.

    Specify primary key and distribution columns

  9. In the lower-right corner, click Precheck. DTS runs a precheck before starting the task. If any items fail, click the icon next to each failed item to view details. Fix the issues and run the precheck again, or ignore the failed items and recheck.

  10. After the precheck passes and The precheck is passed. is displayed, close the Precheck dialog box. The task starts automatically.

  11. Wait until the initial synchronization completes and the task enters the Synchronizing state. Monitor the task status on the Synchronization Tasks page. View the status of a data synchronization task

Performance considerations

DTS reads from and writes to both the source and destination databases during initial full data synchronization, which increases database load. Load increases significantly if the source database has many slow SQL queries, tables without primary keys, or if deadlocks occur in the destination database — and may cause database services to become unavailable.

Run the synchronization task during off-peak hours — when CPU utilization on both the source and destination databases is below 30%.

Billing

Synchronization typeFee
Schema synchronization and full data synchronizationFree of charge
Incremental data synchronizationCharged. For more information, see Billing overview.