All Products
Search
Document Center

Data Transmission Service:Migrate Amazon RDS for PostgreSQL to Alibaba Cloud

Last Updated:Jun 24, 2026

This article describes how to use Data Transmission Service (DTS) to perform a full migration of your data from Amazon RDS for PostgreSQL to Alibaba Cloud RDS for PostgreSQL.

Prerequisites

  • The Amazon RDS for PostgreSQL instance must run database version 9.4 or later.

  • To allow DTS to connect to the Amazon RDS for PostgreSQL instance over the public network, set the Publicly accessible option to Yes.

  • You have created an ApsaraDB RDS for PostgreSQL instance. For more information, see Create an ApsaraDB RDS for PostgreSQL instance.

    Note

    The destination ApsaraDB RDS for PostgreSQL instance should have the same major database version as the source Amazon RDS for PostgreSQL instance. If you need to migrate data across different major versions, create a pay-as-you-go instance to verify compatibility.

  • The storage space for the destination ApsaraDB RDS for PostgreSQL instance must be larger than the size of the data to be migrated from the source Amazon RDS for PostgreSQL instance.

Limitations

  • During a full data migration, DTS consumes read and write resources on the source and destination databases, increasing their load. If your databases have poor performance, low specifications, or high workloads (for example, if the source database has many slow SQL queries or tables without primary keys, or if deadlocks occur in the destination database), the increased load can strain your databases or even cause service interruptions. Perform the data migration during off-peak hours, such as when the CPU utilization of both databases is below 30%.

  • Incremental data migration is not supported. Before starting the full data migration, stop all write operations to the source instance. This ensures data consistency by preventing new data from being written during the migration.

  • A single data migration task can migrate only one database. To migrate multiple databases, create a separate data migration task for each.

  • DTS does not support migrating functions written in C.

  • If a source table lacks a primary key or a unique constraint and contains non-unique data, duplicate data may be created in the destination database.

  • DTS automatically recovers failed tasks. Before switching workloads to the destination instance, Stop or Release the task. Otherwise, an automatic recovery may overwrite the destination instance's data with source data.

Billing

Migration type

Configuration fee

Internet traffic fee

schema migration and full data migration

Free of charge

You are charged for data transferred from Alibaba Cloud over the Internet. For more information, see billing overview.

Migration types

  • Schema migration

    DTS migrates the schema definitions for migration objects—including tables, triggers, views, sequences, functions, user-defined types, rules, domains, operations, and aggregates—to Alibaba Cloud RDS for PostgreSQL.

  • Full data migration

    DTS migrates all existing data from the migration objects to Alibaba Cloud RDS for PostgreSQL.

Database account permissions

Database

Schema migration

Full data migration

Amazon RDS for PostgreSQL

USAGE on pg_catalog

SELECT on objects to be migrated

ApsaraDB RDS for PostgreSQL

CREATE and USAGE on objects to be migrated

Owner permissions on the schema

Full data migration

To resolve object dependencies and improve the migration success rate, DTS migrates the schema and data of a PostgreSQL instance in the following order:

  1. Schema migration for tables, views, sequences, functions, user-defined types, rules, domains, operations, and aggregates.

  2. Full data migration.

  3. Schema migration for triggers and foreign keys.

Preparation 1: Configure security group inbound rules

  1. Log on to the Amazon RDS Management Console.

  2. Go to the Basic Information page of your Amazon RDS for PostgreSQL instance.

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

  4. On the Security group settings page, add the IP address range of the DTS servers for the destination region to the inbound rules. For the specific IP address ranges, see Add DTS server IP addresses to an IP allowlist.

    On the Inbound tab, click Edit. In the Edit inbound rules dialog box, set Type to custom TCP rule, set port range to 5432, and set Source to Custom. Enter the IP address range of the DTS servers for the destination region, and then click Save.

    Note
    • Add only the CIDR blocks for DTS servers in the destination database's region. For example, if your source database is in the Singapore region and your destination database is in the China (Hangzhou) region, you only need to add the CIDR blocks for DTS servers in the China (Hangzhou) region.

    • You can add multiple CIDR blocks to a single rule.

    • For more information, see the official AWS documentation or contact AWS Support.

Preparation 2: Create databases and schemas

In the destination Alibaba Cloud RDS for PostgreSQL instance, create corresponding databases and schemas for the objects you are migrating. The schema names must match the source schema names. For more information, see Create a database and Manage schemas.

Procedure (New console)

  1. Navigate to the migration task list page for the destination region using one of the following methods.

    From the DTS console

    1. Log on to the Data Transmission Service (DTS) console.

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

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

    From the DMS console

    Note

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

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

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

    3. To the right of Data Migration Tasks, select the region where the migration instance is located.

  2. Click Create Task to navigate to the task configuration page.

  3. Configure the source and destination databases.

    Warning

    After you select the source and destination instances, we recommend that you carefully read the limits displayed at the top of the page. Otherwise, the task may fail or data inconsistency may occur.

    Category

    Parameter

    Description

    N/A

    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 a DMS database instance.

    You can choose whether to use an existing instance, as needed.

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

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

    Note

    Database Type

    Select PostgreSQL.

    Connection Type

    Select Public IP Address.

    Instance Region

    Select the region where your Amazon RDS for PostgreSQL instance is located.

    Note

    If the region of your Amazon RDS for PostgreSQL instance is not available, select the geographically closest region.

    Domain Name or IP

    Enter the endpoint of your Amazon RDS for PostgreSQL instance.

    Note

    You can obtain the endpoint from the Basic Information page of your Amazon RDS for PostgreSQL instance.

    Port Number

    Enter the service port of your Amazon RDS for PostgreSQL instance. The default port is 5432.

    Database Name

    Enter the name of the database to migrate from your Amazon RDS for PostgreSQL instance.

    Database Account

    Enter the database account of the Amazon RDS for PostgreSQL instance. For information about the required permissions, see Permissions required for database accounts.

    Database Password

    Enter the password for the database account.

    Encryption

    Select a connection method. In this example, Non-encrypted is selected.

    If you need to connect to the database by using SSL encryption, select SSL-encrypted, and then upload the CA Certificate, Client Certificate, and Private Key of Client Certificate as needed. Then, enter the Private Key Password of Client Certificate.

    Note
    • If you select SSL-encrypted for a self-managed PostgreSQL database, you must upload the CA Certificate.

    • If you need to use a client certificate, you must upload both the Client Certificate and the Private Key of Client Certificate, and then enter the Private Key Password of Client Certificate.

    • For information about the SSL encryption feature for an RDS for PostgreSQL instance, see SSL connection encryption.

    Destination Database

    Select a DMS database instance.

    You can choose whether to use an existing instance, as needed.

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

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

    Note

    Database Type

    Select PostgreSQL.

    Connection Type

    Select Alibaba Cloud Instance.

    Instance Region

    Select the region where the destination ApsaraDB RDS for PostgreSQL instance is located.

    Instance ID

    Select the ID of the destination ApsaraDB RDS for PostgreSQL instance.

    Database Name

    Enter the name of the destination database in the ApsaraDB RDS for PostgreSQL instance. The name can be different from the name of the source database.

    Note

    The database must already exist in the ApsaraDB RDS for PostgreSQL instance. For more information, see Create a database.

    Database Account

    Enter the database account for the destination ApsaraDB RDS for PostgreSQL instance. For information about the required permissions, see Permissions required for database accounts.

    Database Password

    Enter the password for the database account.

    Encryption

    Select a connection method. In this example, Non-encrypted is selected.

    If you need to connect to the database by using SSL encryption, select SSL-encrypted, and then upload the CA Certificate, Client Certificate, and Private Key of Client Certificate as needed. Then, enter the Private Key Password of Client Certificate.

    Note
    • If you select SSL-encrypted for a self-managed PostgreSQL database, you must upload the CA Certificate.

    • If you need to use a client certificate, you must upload both the Client Certificate and the Private Key of Client Certificate, and then enter the Private Key Password of Client Certificate.

    • For information about the SSL encryption feature for an RDS for PostgreSQL instance, see SSL connection encryption.

  4. After you complete the configuration, click Test Connectivity and Proceed at the bottom of the page. In the CIDR Blocks of DTS Servers dialog box that appears, click Test Connectivity.

    Note

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

  5. Configure the task objects.

    1. On the Configure Objects page, configure the objects that you want to migrate.

      Parameter

      Description

      Migration Types

      Select both Schema Migration and Full Data Migration.

      Note

      To ensure data consistency, do not write new data to the Amazon RDS for PostgreSQL database during the migration.

      Processing Mode of Conflicting Tables

      • Precheck and Report Errors: Checks whether tables with the same names exist in the destination database. If no tables with the same names exist, the precheck is passed. If tables with the same names exist, an error is reported during the precheck, and the data migration task does not start.

        Note

        If a table in the destination database has the same name but cannot be easily deleted or renamed, you can change the name of the table in the destination database. For more information, see Object name mapping.

      • Ignore Errors and Proceed: Skips the check for tables with the same names.

        Warning

        Selecting Ignore Errors and Proceed may cause data inconsistency and business risks. For example:

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

          • During full migration, DTS keeps the record in the destination database. The record from the source database is not migrated.

          • During incremental migration, DTS does not keep the record in the destination database. The record from the source database overwrites the record in the destination database.

        • If the table schemas are inconsistent, only some columns of data may be migrated, or the migration may fail. Proceed with caution.

      Capitalization of Object Names in Destination Instance

      You can configure the case sensitivity policy for the names of migrated objects, such as databases, tables, and columns, in the destination instance. By default, DTS default policy is selected. You can also choose to keep the case sensitivity consistent with the default policy of the source or destination database. For more information, see Case sensitivity of object names in the destination database.

      Source Objects

      Select one or more objects from the Source Objects section. Click the Rightwards arrow icon and add the objects to the Selected Objects section.

      Note

      The granularity for selecting migration objects is schema, table, and column. If you select only tables or columns as migration objects, other objects such as views, triggers, and stored procedures are not migrated to the destination database.

      Selected Objects

      Note

      If you use the object name mapping feature, other objects that depend on the mapped object may fail to migrate.

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

      Parameter

      Description

      Dedicated Cluster for Task Scheduling

      By default, DTS schedules tasks on a shared cluster. You do not need to select one. If you want more stable tasks, you can purchase a dedicated cluster to run DTS migration tasks.

      Retry Time for Failed Connections

      After the migration task starts, if the connection to the source or destination database fails, 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 1440 minutes. We recommend that you set the duration to more than 30 minutes. If DTS reconnects to the source and destination databases within the specified duration, the migration task automatically resumes. Otherwise, the task fails.

      Note
      • For multiple DTS instances that share the same source or destination, the network retry time is determined by the setting of the last created task.

      • Because you are charged for the task during the connection retry period, we recommend that you customize the retry time based on your business needs, or release the DTS instance as soon as possible after the source and destination database instances are released.

      Retry Time for Other Issues

      After the migration task starts, if a non-connectivity issue, such as a DDL or DML execution exception, occurs in the source or destination database, DTS reports an error and immediately begins to retry the operation. The default retry duration is 10 minutes. You can customize the retry time to a value from 1 to 1440 minutes. We recommend that you set the duration to more than 10 minutes. If the related operations succeed within the specified retry duration, the migration task automatically resumes. Otherwise, the task fails.

      Important

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

      Enable Throttling for Full Data Migration

      During full migration, DTS consumes read and write resources on the source and destination databases, which may increase the database load. If required, you can enable throttling for the full migration task. You can set Queries per second (QPS) to the source database, RPS of Full Data Migration, and Data migration speed for full migration (MB/s) to reduce the load on the destination database.

      Note
      • This configuration item is available only if you select Full Data Migration for Migration Types.

      • You can also adjust the full migration speed after the migration instance is running.

      Environment Tag

      You can select an environment tag to identify the instance based on your requirements. This is not 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

      Select whether to set alerts and receive alert notifications based on your business needs.

      • No: Does not set an alert.

      • Yes: Configure alerts by setting an alert threshold and an alert notifications. If a migration fails or the latency exceeds the threshold, the system sends an alert notification.

    3. Click Next: Data Validation to configure a data validation task.

      For more information about the data validation feature, see Configure data validation.

  6. Save the task and run a precheck.

    • To view the parameters for configuring this instance when you call the API operation, move the 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 or have finished viewing the API parameters, click Next: Save Task Settings and Precheck at the bottom of the page.

    Note
    • Before the migration task starts, DTS performs a precheck. The task starts only after it passes the precheck.

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

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

  7. Purchase the instance.

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

    2. On the Purchase page, select the link specification for the data migration instance. For more information, see the following table.

      Category

      Parameter

      Description

      New Instance Class

      Resource Group Settings

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

      Instance Class

      DTS provides migration specifications with different performance levels. The link specification affects the migration speed. You can select a specification based on your business scenario. For more information, see Data migration link specifications.

    3. After the configuration is complete, read and select Data Transmission Service (Pay-as-you-go) Service Terms.

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

      You can view the progress of the migration task on the Data Migration Tasks list page.

      Note
      • If the migration task does not include incremental migration, it stops automatically after the full migration is complete. After the task stops, its Status changes to Completed.

      • If the migration task includes incremental migration, it does not stop automatically. The incremental migration task continues to run. While the incremental migration task is running, the Status of the task is Running.

Procedure (old console)

  1. Log on to the DTS console.

    Note

    If you are automatically redirected to the Data Management (DMS) console, you can click the jiqiren icon in the lower-right corner and then click 返回旧版 to return to the classic DTS console.

  2. In the left-side navigation pane, click Data Migration.

  3. At the top of the Migration Tasks page, select the region of the destination cluster.

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

  5. Configure the source and destination databases.

    Category

    Parameter

    Description

    N/A

    Task name

    DTS automatically generates a task name. We recommend using a descriptive name for easier identification. The name does not need to be unique.

    Source instance information

    Instance type

    Select Self-managed database with a public IP.

    Instance region

    The region of the source instance. This parameter is not required if you set Instance Type to Self-managed database with a public IP.

    Database type

    Select PostgreSQL.

    Hostname or IP address

    Enter the endpoint of your Amazon RDS for PostgreSQL instance.

    Note

    You can find the database connection information on the Basic Information page in Amazon RDS for PostgreSQL.

    On the Connectivity & security tab, in the Endpoint and port section, copy the value of Endpoint. The endpoint is in the format xxx.rds.amazonaws.com.

    Port

    Enter the service port of the Amazon RDS for PostgreSQL instance. The default value is 5432.

    Database name

    Enter the name of the database to migrate.

    Database account

    Enter the database account for the source instance. For information about the required permissions, see Required permissions for database accounts.

    Database password

    Enter the password for the database account.

    Note

    After you configure the source database, click Test Connectivity next to Database Password to test the connection. If the test passes, Passed is displayed. If Failed is displayed, click Diagnose next to Failed and adjust the settings based on the results.

    Destination instance information

    Instance type

    Select RDS Instance.

    Instance region

    Select the region of the destination ApsaraDB RDS for PostgreSQL instance.

    RDS instance ID

    Select the ID of the destination ApsaraDB RDS for PostgreSQL instance.

    Database name

    Enter the name of the destination database. This name can be different from the source database name.

    Note

    You must create the database and schema in the ApsaraDB RDS for PostgreSQL instance in advance. For more information, see Preparation 2: Create a database and schema in the ApsaraDB RDS instance.

    Database account

    Enter the database account for the destination instance. For information about the required permissions, see Required permissions for database accounts.

    Database password

    Enter the password for the database account.

    Note

    After you configure the destination database, click Test Connectivity next to Database Password to test the connection. If the test passes, Passed is displayed. If Failed is displayed, click Diagnose next to Failed and adjust the settings based on the results.

  6. After you complete the configuration, click Add Whitelist and Proceed to Next Step in the lower-right corner of the page.

    If the source or destination is an Alibaba Cloud database instance such as ApsaraDB for RDS or ApsaraDB for MongoDB, DTS automatically adds the CIDR blocks of its servers in the corresponding region to the instance's whitelist. If the source or destination is a self-managed database on an ECS instance, DTS automatically adds its CIDR blocks to the security group rules of that ECS instance. You must also ensure that the self-managed database allows access from the ECS instance. If your database is deployed as a cluster across multiple ECS instances, you must manually add the DTS CIDR blocks to the security group rules for all other ECS instances in the cluster. If the source or destination is a self-managed database in an on-premises data center or on another cloud platform, you must manually add the CIDR blocks of the DTS servers for the corresponding region to allow access. For a list of DTS server CIDR blocks, see CIDR blocks of DTS servers.

    Warning

    Adding the public CIDR blocks of DTS servers, whether automatically or manually, may introduce security risks. By using this product, you acknowledge and accept these potential risks. You are responsible for implementing basic security measures, including but not limited to using strong passwords, restricting open ports, using authentication for internal API calls, regularly reviewing and restricting unnecessary network segments, or connecting through private networks such as Express Connect, VPN Gateway, or Smart Access Gateway.

  7. Select migration types and migration objects.

    Parameter

    Description

    Migration types

    Incremental Data Migration is not supported. Select both Schema Migration and Full Data Migration.

    Note

    To ensure data consistency, do not write new data to the source database during the migration.

    Migration objects

    In the Available Objects box, select the objects that you want to migrate and click the 向右小箭头 icon to move them to the Selected Objects box.

    Note
    • You can select objects at the database, table, or column level.

    • By default, destination object names are the same as their source counterparts. To rename an object in the destination database, use object name mapping. For more information, see Object name mapping.

    • If you use object name mapping, the migration of other objects that depend on a renamed object may fail.

    Map to another name

    To rename migrated objects in the destination instance, use object name mapping. For more information, see Object name mapping.

    Connection retry duration

    The default retry duration is 12 hours. You can also specify a custom duration. If DTS reconnects to the source and destination databases within the specified duration, the migration task automatically resumes. Otherwise, the task fails.

    Note

    DTS charges for task runtime during the retry period. We recommend that you specify a retry duration that is based on your business requirements or release the DTS instance as soon as the source and destination database instances are released.

  8. After you complete the configuration, click Precheck and Start in the lower-right corner of the page.

    Note
    • Before the migration task starts, DTS runs a precheck. The task can start only after it passes the precheck.

    • If the precheck fails, click the 提示 icon next to the failed item to view details.

      • Fix the issues as prompted and run the precheck again.

      • If you do not need to fix the warning items, you can select Ignore and then click Ignore Warnings and Rerun Precheck to run the precheck again.

  9. After the task passes the precheck, click Next.

  10. In the Confirm Settings dialog box that appears, select a Instance Class and select the Data Transmission Service (pay-as-you-go) Service Terms checkbox.

  11. Click Buy and Start to start the data migration task.
    Note We recommend that you do not manually stop the task during full data migration. Otherwise, the data migrated to the destination database will be incomplete. You can wait until the data migration task automatically stops.
    Full data migration
  12. Switch your business workloads to the ApsaraDB RDS for PostgreSQL instance.