All Products
Search
Document Center

ApsaraDB RDS:Migrate incremental data from an Amazon RDS for PostgreSQL instance to an ApsaraDB RDS for PostgreSQL instance

Last Updated:Mar 28, 2026

Data Transmission Service (DTS) lets you migrate data from an Amazon RDS for PostgreSQL instance to an ApsaraDB RDS for PostgreSQL instance with minimal downtime. DTS supports schema migration, full data migration, and incremental data migration. Selecting all three types keeps the source database operational throughout the migration, allowing a controlled cutover.

Prerequisites

Before you begin, make sure that you have:

  • An Amazon RDS for PostgreSQL instance running version 10.4 or later

  • Public accessibility enabled on the Amazon RDS instance (set to Yes), so DTS can reach it over the Internet

  • rds.logical_replication set to 1 on the Amazon RDS instance, so DTS can read incremental data

  • An ApsaraDB RDS for PostgreSQL instance already created. For instructions, see Create an ApsaraDB RDS for PostgreSQL instance

  • Enough free storage on the ApsaraDB RDS instance to hold all data from the source instance

Use the same major PostgreSQL version on both the source and destination. If the versions differ, create a pay-as-you-go instance to verify compatibility before committing to the migration.

Limitations

Functional limitations

LimitationImpactAction
DML only for incremental migrationDTS migrates only INSERT, DELETE, and UPDATE operations. DDL operations are not captured.Do not run DDL on source objects before incremental migration starts. Affected objects may fail to migrate.
Single database per taskEach migration task covers one database.Create a separate task for each database you want to migrate.
Primary key or unique constraint requiredObjects without a PRIMARY KEY or UNIQUE constraint (with all unique fields) may produce duplicate records or cause the task to fail.Add a primary key or unique constraint to all objects before migration.
C-language functions excludedDTS does not migrate PostgreSQL functions written in C.Manually recreate these functions on the destination after migration.

Operational considerations

SituationBehaviorAction
Replication slot managementDTS creates a replication slot prefixed with dts_sync_ and clears historical slot data every 90 minutes to limit storage growth.No action required during normal operation.
Task released or failedDTS automatically removes the replication slot.No manual cleanup needed.
Primary/secondary switchover on sourceThe DTS task fails and may not resume automatically. The replication slot is not automatically cleared on the new primary.Log in to the secondary database and manually delete the replication slot (see the screenshot below).
Resuming a failed taskIf DTS resumes the task automatically, it continues writing source data to the destination.Stop or release the task before switching workloads to the destination, or destination data may be overwritten.
Performance impact during full migrationFull data migration consumes read and write resources on both databases.Run the migration during off-peak hours when CPU utilization on both instances is below 30%.
Amazon slot query

Billing

Migration typeTask configuration feeInternet traffic fee
Schema migration and full data migrationFreeCharged only when data is migrated from Alibaba Cloud over the Internet. See Billing overview.
Incremental data migrationCharged. See Billing overview.

Migration types

Schema migration — DTS migrates object schemas to the destination: tables, triggers, views, sequences, functions, user-defined types, rules, domains, operations, and aggregates. Functions written in C are excluded.

Full data migration — DTS migrates all existing data from the source to the destination.

Incremental data migration — After full data migration completes, DTS continuously captures and applies changes from the source. This keeps the destination in sync while your applications remain connected to the source, allowing a controlled cutover.

Required permissions

DatabaseSchema migrationFull data migrationIncremental data migration
Amazon RDS for PostgreSQLUSAGE on pg_catalogSELECT on objects to be migratedrds_superuser
ApsaraDB RDS for PostgreSQLCREATE and USAGE on objects to be migratedSchema owner permissionsSchema owner permissions

Migration order

DTS migrates objects in the following order to avoid dependency failures:

  1. Schemas of tables, views, sequences, functions, user-defined types, rules, domains, operations, and aggregates

  2. Full data migration

  3. Schemas of triggers and foreign keys

  4. Incremental data migration

Important

Do not run DDL operations on source objects before incremental migration starts. Objects affected by DDL changes may fail to migrate.

Add DTS server IP addresses to the Amazon RDS security group

Before creating the migration task, allow DTS servers to reach the Amazon RDS instance.

  1. Log in to the Amazon RDS Management Console and navigate to the region where the instance resides.

  2. In the left navigation pane, click Databases, then click the database identifier.

    Click database identifier

  3. In the Security group rules section, click the name of the security group that contains the existing inbound rule.

    Security group rules

  4. On the Security Groups page, click the Inbound tab, then click Edit. Add the CIDR blocks of DTS servers in the same region as your destination ApsaraDB RDS instance. For the list of DTS server CIDR blocks by region, see Add the CIDR blocks of DTS servers.

    Add only the CIDR blocks for the region where your destination database resides. For example, if the destination is in China (Hangzhou), add only the China (Hangzhou) DTS CIDR blocks. You can add all required CIDR blocks in a single edit.

    AWS PostgreSQL inbound rules

Create the migration task

In the new DTS console

  1. Go to the Data Migration page.

    • DTS console: Log in to the DTS console. In the left navigation pane, click Data Migration. In the upper-left corner, select the region where the migration instance will reside.

    • DMS console: Log in to the DMS console. In the top navigation bar, go to Data + AI > DTS (DTS) > Data Migration. From the drop-down list next to Data Migration Tasks, select the target region. > Note: The DMS console layout may vary. See Simple mode and Customize the layout and style of the DMS console.

  2. Click Create Task.

  3. Configure the source and destination databases.

    Warning

    Read the Limits displayed at the top of the configuration page before proceeding. Skipping this step may cause task failures or data inconsistencies.

    Source database

    ParameterDescription
    Task NameA name for the DTS task. DTS generates one automatically; update it to something descriptive. Uniqueness is not required.
    Select a DMS database instanceSelect an existing registered instance, or leave blank to configure connection details manually. To register a database instance, see Register an Alibaba Cloud database instance or Register a database hosted on a third-party cloud service or a self-managed database.
    Database TypeSelect PostgreSQL.
    Access MethodSelect Public IP Address.
    Instance RegionThe region where the Amazon RDS instance resides. If the region is not listed, select the geographically closest one.
    Domain Name or IPThe endpoint of the Amazon RDS instance. Find this on the instance's basic information page.
    Port NumberThe PostgreSQL service port. Default: 5432.
    Database NameThe name of the source database.
    Database AccountThe database account. See Required permissions for the minimum permissions needed.
    Database PasswordThe password for the database account.
    EncryptionSelect Non-encrypted or SSL-encrypted. For SSL, upload the CA Certificate and, if using client certificate authentication, the Client Certificate, Private Key of Client Certificate, and Private Key Password of Client Certificate. For more information, see SSL encryption.

    Destination database

    ParameterDescription
    Select a DMS database instanceSelect an existing registered instance, or configure connection details manually.
    Database TypeSelect PostgreSQL.
    Access MethodSelect Alibaba Cloud Instance.
    Instance RegionThe region where the ApsaraDB RDS instance resides.
    Instance IDThe ID of the ApsaraDB RDS for PostgreSQL instance.
    Database NameThe destination database name. It can differ from the source database name. Create the database in advance. See Create a database.
    Database AccountThe database account. See Required permissions.
    Database PasswordThe password for the database account.
    EncryptionSelect Non-encrypted or SSL-encrypted as needed.
  4. Click Test Connectivity and Proceed, then click Test Connectivity in the CIDR Blocks of DTS Servers dialog box.

    DTS server CIDR blocks must be added to the security settings of the source and destination databases before this step. See Add the CIDR blocks of DTS servers.
  5. Configure the objects to migrate. On the Configure Objects page, set the following parameters:

    Renaming an object with object name mapping may cause dependent objects to fail migration.
    ParameterDescription
    Migration TypesSelect Schema Migration and Incremental Migration. Selecting all supported types is strongly recommended.
    Processing Mode of Conflicting TablesPrecheck and Report Errors (default): fails the precheck if tables with identical names exist in the destination. Use object name mapping to rename conflicting objects. Ignore Errors and Proceed: skips the precheck. During full migration, conflicting records are skipped; during incremental migration, they are overwritten. Use with caution — this may cause data inconsistencies.
    Capitalization of Object Names in Destination InstanceControls the case of database, table, and column names in the destination. Default: DTS default policy. See Specify the capitalization of object names in the destination instance.
    Source ObjectsSelect objects from the Source Objects list and click 向右小箭头 to move them to Selected Objects. You can select columns, tables, or schemas. Selecting tables or columns excludes other object types such as views, triggers, and stored procedures.
    Selected ObjectsTo rename a single object, right-click it in the Selected Objects list. To rename multiple objects at once, click Batch Edit. See Map object names. To filter rows with a WHERE condition, right-click a table and specify the condition. See Specify filter conditions.
  6. Click Next: Advanced Settings and configure optional parameters.

    ParameterDescription
    Dedicated Cluster for Task SchedulingBy default, DTS uses a shared cluster. To improve task stability, purchase a dedicated cluster. See What is a DTS dedicated cluster?
    Retry Time for Failed ConnectionsHow long DTS retries after a connection failure. Valid values: 10–1,440 minutes. Default: 720 minutes. Set to at least 30 minutes. If multiple tasks share the same database, the most recently configured value takes precedence.
    Retry Time for Other IssuesHow long DTS retries after DDL or DML failures. Valid values: 1–1,440 minutes. Default: 10 minutes. Must be less than Retry Time for Failed Connections.
    Enable Throttling for Full Data MigrationLimits read/write throughput during full migration. Configure Queries per second (QPS) to the source database, RPS of Full Data Migration, and Data migration speed for full migration (MB/s). Available only when Full Data Migration is selected.
    Enable Throttling for Incremental Data MigrationLimits throughput during incremental migration. Configure RPS of Incremental Data Migration and Data migration speed for incremental migration (MB/s). Available only when Incremental Data Migration is selected.
    Environment TagOptional tags to identify the instance.
    Configure ETLEnable the extract, transform, and load (ETL) feature to process data during migration. See What is ETL? and Configure ETL in a data migration or data synchronization task.
    Monitoring and AlertingConfigure alerts for task failures or high migration latency. When enabled, specify the alert threshold and notification settings. See Configure monitoring and alerting.
  7. Click Next Step: Data Verification to configure data verification. See Configure a data verification task.

  8. Click Next: Save Task Settings and Precheck. DTS runs a precheck before starting the task. If the precheck fails:

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

    • If an alert item can be safely ignored, click Confirm Alert Details > Ignore > OK, then click Precheck Again. Ignoring alerts may cause data inconsistencies.

    To preview the API parameters for this configuration, hover over Next: Save Task Settings and Precheck and click Preview OpenAPI parameters.
  9. Once Success Rate reaches 100%, click Next: Purchase Instance.

  10. On the Purchase Instance page, configure the instance.

    ParameterDescription
    Resource GroupThe resource group for the migration instance. Default: default resource group. See What is Resource Management?
    Instance ClassThe instance class determines migration speed. See Instance classes of data migration instances.
  11. Select Data Transmission Service (Pay-as-you-go) Service Terms, then click Buy and Start > OK. The migration task starts. Track its progress on the Data Migration page.

In the old DTS console

  1. Log in to the DTS console.

    If you are redirected to the DMS console, click the old icon in the image to return to the previous DTS console version.
  2. In the left navigation pane, click Data Migration.

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

  4. In the upper-right corner, click Create Migration Task.

  5. Configure the source and destination databases.

    SectionParameterDescription
    N/ATask NameA descriptive name for the task. Uniqueness is not required.
    Source DatabaseInstance TypeSelect User-Created Database with Public IP Address.
    Instance RegionNot required when User-Created Database with Public IP Address is selected.
    Database TypeSelect PostgreSQL.
    Hostname or IP AddressThe endpoint of the Amazon RDS instance. Find this on the instance's basic information page. 连接地址
    Port NumberDefault: 5432.
    Database NameThe source database name.
    Database AccountThe database account. See Required permissions.
    Database PasswordThe account password. Click Test Connectivity after entering the password to validate the configuration.
    Destination DatabaseInstance TypeSelect RDS Instance.
    Instance RegionThe region where the ApsaraDB RDS instance resides.
    RDS Instance IDThe ID of the ApsaraDB RDS for PostgreSQL instance.
    Database NameThe destination database name. It can differ from the source. Create the database in advance. See Create a database.
    Database AccountThe database account. See Required permissions.
    Database PasswordThe account password. Click Test Connectivity to validate.

    Source and destination database configuration

  6. Click Set Whitelist and Next. DTS automatically adds its server CIDR blocks to the IP whitelist of Alibaba Cloud database instances and to the security group rules of ECS-hosted databases. For third-party or on-premises databases, add the CIDR blocks manually. See Add the CIDR blocks of DTS servers.

    Warning

    Adding DTS server CIDR blocks to a database whitelist or ECS security group introduces security exposure. Before proceeding, take protective measures such as using strong credentials, restricting exposed ports, enabling API call authentication, auditing whitelist rules regularly, and connecting through Express Connect, VPN Gateway, or Smart Access Gateway where possible.

  7. Select migration types and objects.

    SettingDescription
    Migration typesSelect Schema Migration, Full Data Migration, and Incremental Data Migration.
    Objects to migrateSelect objects from Available and click 向右小箭头 to move them to Selected. You can select columns, tables, or schemas. To rename objects in the destination, use the object name mapping feature. See Object name mapping.
    Retry time for failed connectionsHow long DTS retries on connection failure. Default: 12 hours.

    Select migration types and objects

  8. Click Precheck. Resolve any failed items by clicking the Info icon icon, fixing the underlying issue, and running the precheck again. You can also ignore non-critical items and rerun.

  9. After the precheck passes, click Next.

  10. In the Confirm Settings dialog box, select a Channel Specification and accept Data Transmission Service (Pay-As-You-Go) Service Terms.

  11. Click Buy and Start.

Cut over to the destination instance

Incremental data migration does not stop automatically. Cut over at a time that minimizes disruption — off-peak hours are recommended.

  1. On the Data Migration page, wait until the task status shows Incremental Data Migration and The migration task is not delayed.

  2. Stop all writes to the source database and wait for the incremental migration latency to drop to The migration task is not delayed again.

    Stop incremental migration task

  3. Manually stop the migration task.

  4. Update your application connection strings to point to the ApsaraDB RDS for PostgreSQL instance.Create a database

What's next