All Products
Search
Document Center

Data Transmission Service:Synchronize data from an RDS MariaDB instance to an RDS PostgreSQL instance

Last Updated:Mar 30, 2026

Use Data Transmission Service (DTS) to synchronize data in real time from an ApsaraDB RDS for MariaDB instance to an ApsaraDB RDS for PostgreSQL instance. DTS supports schema synchronization, full data synchronization, and incremental data synchronization for this path.

Prerequisites

Before you begin, make sure that:

  • A destination ApsaraDB RDS for PostgreSQL instance is created. For more information, see Create an ApsaraDB RDS for PostgreSQL instance.

  • The available storage space of the destination instance is larger than the total data size in the source instance.

Billing

Synchronization type Fee
Schema synchronization and full data synchronization Free of charge
Incremental data synchronization Charged. For more information, see Billing overview.

Supported synchronization topologies

  • One-way one-to-one synchronization

  • One-way one-to-many synchronization

  • One-way many-to-one synchronization

SQL operations that can be synchronized

DTS supports synchronizing DML operations only: INSERT, UPDATE, and DELETE.

Permissions required

Grant the following permissions to the database accounts used by DTS before creating the task.

Database Required permission
ApsaraDB RDS for MariaDB SELECT
ApsaraDB RDS for PostgreSQL CREATE and USAGE on the objects to be synchronized, and owner permissions on schemas

For instructions, see Create an account on a MariaDB instance and Modify or reset account permissions for MariaDB. For PostgreSQL, see Create an account on a PostgreSQL instance and Authorize the service account of an RDS PostgreSQL instance.

Limitations

Source database

  • Tables to be synchronized must have PRIMARY KEY or UNIQUE constraints, with all fields unique. Otherwise, duplicate records may appear in the destination database.

  • If you select tables (not an entire database) and need to rename tables or columns in the destination, a single task can synchronize up to 1,000 tables. For more than 1,000 tables, configure multiple tasks or synchronize the entire database instead.

  • Binary logging is enabled by default on ApsaraDB RDS for MariaDB. The following binary log settings are required:

    Parameter Required value Notes
    binlog_row_image full Must be set before starting the task. If not set to full, the precheck fails. See Modify parameters.
    Binary log retention period At least 24 hours (incremental sync only) or at least 7 days (full + incremental sync) After full data synchronization completes, you can set the retention period to more than 24 hours. Insufficient retention may cause the task to fail or result in data inconsistency or data loss. Retention periods that do not meet these requirements are outside the DTS service level agreement (SLA).

Other limitations

  • The destination database version must be the same as or later than the source database version. Earlier destination versions may cause compatibility issues.

  • Run the task during off-peak hours. During initial full data synchronization, DTS uses read and write resources on both databases, which may increase database load.

  • After full data synchronization, the tablespace of the destination database is larger than that of the source database due to fragmentation from concurrent INSERT operations.

  • During schema synchronization, DTS synchronizes foreign keys from the source database to the destination database.

  • During full data synchronization and incremental data synchronization, DTS temporarily disables foreign key constraint checks and cascade operations at the session level. If cascade UPDATE or DELETE operations are performed on the source database during synchronization, data inconsistency may occur.

  • If you select tables (not an entire database), do not use tools such as pt-online-schema-change for online DDL operations during synchronization. Use Data Management (DMS) instead. For more information, see Perform lock-free DDL operations.

  • Write data to the destination database through DTS only during synchronization. If other tools write to the destination database concurrently, do not use DMS for online DDL operations, as this may cause data loss.

  • If a TIMESTAMP field has the value 0 in the source database, DTS converts it to null in the destination database.

Limitations for self-managed MariaDB sources

These limitations apply only if the source is a self-managed MariaDB database, not an ApsaraDB RDS for MariaDB instance.

  • If a primary/secondary switchover occurs on the source database while the task is running, the task fails.

  • DTS calculates synchronization latency based on the timestamp of the latest synchronized record in the destination and the current timestamp in the source. If no DML operations are performed on the source for an extended period, the reported latency may be inaccurate. To refresh the latency, perform a DML operation on the source. If you synchronize an entire database, create a heartbeat table — DTS updates it every second.

  • DTS periodically runs CREATE DATABASE IF NOT EXISTS \test\`` on the source to advance the binary log file position.

Create a data synchronization task

The overall workflow is:

  1. Configure source and destination databases.

  2. Test connectivity and allow DTS to access both databases.

  3. Select objects and configure synchronization types.

  4. Configure advanced settings and run a precheck.

  5. Purchase the synchronization instance and start the task.

Step 1: Open the Data Synchronization Tasks page

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

  2. In the top navigation bar, click Data + AI.

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

Note

Steps may vary based on the DMS console mode. For more information, see Simple mode and Customize the layout and style of the DMS console. You can also go directly to the Data Synchronization Tasks page of the new DTS console.

Step 2: Configure source and destination databases

  1. On the right side of Data Synchronization Tasks, select the region where the synchronization instance will reside.

    Note

    If you use the new DTS console, select the region in the top navigation bar.

  2. Click Create Task. In the Create Task wizard, configure the parameters below.

Source database

Parameter Description
Task Name The task name. DTS generates a name automatically. Specify a descriptive name to make the task easy to identify. The name does not need to be unique.
Database Type Select MariaDB.
Connection Type Select Alibaba Cloud Instance.
Instance Region The region where the source ApsaraDB RDS for MariaDB instance resides.
Replicate Data Across Alibaba Cloud Accounts Select No for same-account synchronization.
Instance ID The ID of the source ApsaraDB RDS for MariaDB instance.
Database Account The database account of the source instance.
Database Password The password for the source database account.
Encryption Select Non-encrypted.

Destination database

Parameter Description
Database Type Select PostgreSQL.
Connection Type Select Alibaba Cloud Instance.
Instance Region The region where the destination ApsaraDB RDS for PostgreSQL instance resides.
Instance ID The ID of the destination ApsaraDB RDS for PostgreSQL instance.
Database Name The name of the destination database.
Database Account The database account of the destination instance. The account must have owner permissions on schemas.
Database Password The password for the destination database account.

Step 3: Test connectivity

Click Test Connectivity and Proceed.

If the source or destination database is an Alibaba Cloud database instance, DTS automatically adds its server CIDR blocks to the whitelist of the instance. If the source or destination database is a self-managed database hosted on an Elastic Compute Service (ECS) instance, DTS automatically adds the CIDR blocks of DTS servers to the security group rules of the ECS instance, and you must ensure that the ECS instance can access the database. For self-managed databases in data centers or hosted by third-party cloud providers, manually add the DTS server CIDR blocks to the database whitelist. For more information, see Add the CIDR blocks of DTS servers.

Warning

Adding DTS CIDR blocks to your database whitelist or security group rules carries security risks. Before proceeding, take preventive measures such as strengthening account credentials, limiting exposed ports, and auditing whitelist entries regularly. Alternatively, connect DTS to the database through Express Connect, VPN Gateway, or Smart Access Gateway.

Step 4: Select objects and synchronization types

Configure the parameters below.

Parameter Description
Synchronization Types By default, Incremental Data Synchronization is selected. Also select Schema Synchronization and Full Data Synchronization. DTS synchronizes historical data first, which is the baseline for incremental synchronization.
Processing Mode of Conflicting Tables Precheck and Report Errors: Checks for tables with identical names in the source and destination. If identical table names exist, the precheck fails and the task cannot start. To resolve name conflicts without deleting destination tables, use the object name mapping feature. For more information, see Map object names. Ignore Errors and Proceed: Skips the precheck for identical table names. If schemas match and a record has the same primary key as an existing record in the destination, DTS skips the record during full data synchronization (keeping the existing record) and overwrites it during incremental synchronization. If schemas differ, some columns may fail to initialize or synchronization may fail. Use with caution.
Source Objects Select objects from the Source Objects section and click 向右 to move them to Selected Objects. You can select columns, tables, or databases. If you select tables or columns, DTS does not synchronize views, triggers, or stored procedures.
Selected Objects To rename a single object, right-click it in the Selected Objects section. To rename multiple objects at once, click Batch Edit in the upper-right corner. For more information, see Map object names.

Step 5: Configure advanced settings

Click Next: Advanced Settings and configure the parameters below.

Parameter Description
Dedicated Cluster for Task Scheduling By default, DTS schedules the task to the shared cluster. To improve task stability, purchase a dedicated cluster. For more information, see What is a DTS dedicated cluster.
Retry Time for Failed Connections How long DTS retries after a connection failure. Valid values: 10–1,440 minutes. Default: 720 minutes. Set this to a value greater than 30. If DTS reconnects within the specified time, the task resumes; otherwise it fails.
Note

When multiple tasks share the same source or destination database, the shortest retry time takes precedence. DTS charges for the instance during retries.

Retry Time for Other Issues How long DTS retries after DDL or DML failures. Valid values: 1–1,440 minutes. Default: 10 minutes. Set this to a value greater than 10. This value must be smaller than the Retry Time for Failed Connections value.
Enable Throttling for Full Data Migration During full data synchronization, DTS uses read and write resources on both databases. To reduce the load on the destination, configure Queries per second (QPS) to the source database, RPS of Full Data Migration, and Data migration speed for full migration (MB/s). This parameter is available only when Full Data Synchronization is selected.
Enable Throttling for Incremental Data Synchronization To reduce load during incremental synchronization, configure RPS of Incremental Data Synchronization and Data synchronization speed for incremental synchronization (MB/s).
Environment Tag An optional tag to identify the DTS instance by environment (for example, production or test).
Configure ETL Whether to enable the extract, transform, and load (ETL) feature. Select Yes to enter data processing statements in the code editor. Select No to skip. For more information, see What is ETL? and Configure ETL in a data synchronization task.

Step 6: Save settings and run the precheck

Click Next: Save Task Settings and Precheck.

Note

To preview the API parameters for this configuration, hover over Next: Save Task Settings and Precheck and click Preview OpenAPI parameters before proceeding.

DTS runs a precheck before the task can start. If any item fails:

  • Click View Details next to the failed item, fix the issue, then click Precheck Again.

  • If an item triggers an alert that can be safely ignored, click Confirm Alert Details, then click Ignore in the View Details dialog box, and confirm. Then click Precheck Again. Ignoring alerts may result in data inconsistency.

Step 7: Purchase the instance and start the task

  1. Wait until the Success Rate reaches 100%, then click Next: Purchase Instance.

  2. On the buy page, configure the following parameters.

    Parameter Description
    Billing Method Subscription: Pay upfront for a fixed period. More cost-effective for long-term use. Subscription duration options: 1–9 months, 1 year, 2 years, 3 years, or 5 years. Pay-as-you-go: Billed hourly. Suitable for short-term use. Release the instance when no longer needed to stop charges.
    Resource Group Settings The resource group for the synchronization instance. Defaults to the default resource group. For more information, see What is Resource Management?
    Instance Class DTS offers instance classes with different synchronization speeds. Select a class based on your workload. For more information, see Instance classes of data synchronization instances.
  3. Read and select Data Transmission Service (Pay-as-you-go) Service Terms.

  4. Click Buy and Start. In the confirmation dialog box, click OK.

The task appears in the task list. Monitor its progress there.