All Products
Search
Document Center

ApsaraDB RDS:Full migration: Amazon RDS for PostgreSQL to Alibaba Cloud

Last Updated:Jun 18, 2026

This topic describes how to perform a full data migration from Amazon RDS for PostgreSQL to ApsaraDB RDS for PostgreSQL by using Data Transmission Service (DTS).

Prerequisites

  • The source Amazon RDS for PostgreSQL instance must be version 9.4 or later.

  • To allow Data Transmission Service (DTS) to connect to the source Amazon RDS for PostgreSQL instance over the public network, set its Publicly accessible option to Yes.

  • Create a destination ApsaraDB RDS for PostgreSQL instance. For details, see Create an instance.

    Note

    The major version of the destination ApsaraDB RDS for PostgreSQL instance should match that of the source Amazon RDS for PostgreSQL instance. To migrate data across major versions, first create a pay-as-you-go instance to test compatibility.

  • The destination ApsaraDB RDS for PostgreSQL instance must have more storage space than the amount of data in the source Amazon RDS for PostgreSQL instance.

Notes

  • 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 migration is not supported. Before you start the data migration, you must stop all services that use the Amazon RDS for PostgreSQL database. To ensure data consistency, do not write new data to the source database during the migration process.

  • A single data migration task can migrate only one database. If you need to migrate multiple databases, you must create a separate data migration task for each.

  • DTS cannot migrate functions written in the C language.

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

  • If a data migration task fails, DTS automatically triggers auto-resume. Before you switch your business workloads to the destination instance, you must stop or release the task. This prevents the task from automatically resuming and overwriting data in the destination instance with data from the source database.

Billing

Migration type

Instance configuration fee

Internet traffic fee

Schema migration and full data migration

Free of charge

You are charged for internet egress from Alibaba Cloud. For more information, see billing overview.

Migration types

  • Structure migration

    Data Transmission Service (DTS) migrates the schema definitions of objects to Alibaba Cloud RDS for PostgreSQL. Supported objects include tables, triggers, views, sequences, functions, user-defined types, rules, domains, operations, and aggregates.

  • Full data migration

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

Database account permissions

Database

Schema migration

Full data migration

Amazon RDS for PostgreSQL

USAGE permission for the pg_catalog schema

SELECT permission for the objects to be migrated

ApsaraDB RDS for PostgreSQL

CREATE and USAGE permissions for the objects to be migrated

Ownership of the schema

Full data migration process

To resolve dependencies between objects, DTS migrates PostgreSQL structures and data in the following order:

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

  2. Full data migration.

  3. Structure migration for triggers and foreign keys.

Prerequisite 1: Configure inbound rules

  1. Log on to the Amazon RDS Management Console.

  2. Navigate 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 addresses of the DTS servers for the target region to the inbound rules. For details about the IP address ranges, see Add IP addresses of DTS servers to the IP allowlist of an on-premises database.

    Click the Inbound rules tab, and then click Edit inbound rules. In the Edit inbound rules dialog box, set Type to custom TCP rule and Port range to 5432. For Source, select Custom and enter the IP addresses of the corresponding DTS servers. Click Save rules.

    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.

Step 2: Create a database and schema

Create a database and schema in your Alibaba Cloud RDS for PostgreSQL instance that match the source database and schema. The schema names must be identical. 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

    Setting

    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 the Amazon RDS for PostgreSQL database is located.

    Note

    If the region is not available in the drop-down list, select the region that is geographically closest to your database.

    Domain Name or IP

    Enter the endpoint of your Amazon RDS for PostgreSQL instance.

    Note

    You can find the endpoint on the Basic Information page of your Amazon RDS for PostgreSQL instance.

    Port Number

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

    Database Name

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

    Database Account

    Enter the database account for 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 RDS PostgreSQL instance is located.

    Instance ID

    Select the ID of the destination RDS PostgreSQL instance.

    Database Name

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

    Note

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

    Database Account

    Enter the database account for the destination RDS 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.

      Setting

      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

      Renaming an object may cause the migration of dependent objects to fail.

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

      Setting

      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. This example does not require a selection.

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

    Category

    Parameter

    Description

    N/A

    Task Name

    DTS automatically generates a task name. Specify a descriptive name for easy identification. The name does not need to be unique.

    Source Instance Information

    Instance Type

    Select User-created database with a public IP address.

    Instance Region

    The region where the source instance is located. This parameter is not required if you select User-created database with a public IP address for Instance Type.

    Database Type

    Select PostgreSQL.

    Hostname or IP address

    Enter the endpoint of the Amazon RDS for PostgreSQL instance.

    Note

    You can obtain the connection information on the Basic Information page of the Amazon RDS for PostgreSQL instance.

    In the Amazon RDS console, select Databases in the left-side navigation pane. On the instance details page, click the Connectivity & security tab, and copy the Endpoint in the Endpoint & port section. The endpoint is a string similar to 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 from the Amazon RDS for PostgreSQL instance.

    Database Account

    Enter the database account for the Amazon RDS for PostgreSQL instance. For the required permissions, see Database account permissions.

    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 Alibaba Cloud RDS for PostgreSQL instance.

    RDS Instance ID

    Select the ID of the destination Alibaba Cloud RDS for PostgreSQL instance.

    Database Name

    Enter the name of the database in the destination Alibaba Cloud RDS for PostgreSQL instance. This name can differ from the source database name.

    Note

    You must create the required database and schema in the Alibaba Cloud RDS for PostgreSQL instance in advance. For more information, see Preparation 2: Create the database and schema in an Alibaba Cloud RDS instance.

    Database Account

    Enter the database account for the Alibaba Cloud RDS for PostgreSQL instance. For the required permissions, see Database account permissions.

    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 Authorize Whitelist and Go to Next Step in the lower-right corner of the page.

    If the source or destination database is an Alibaba Cloud database instance, such as an RDS MySQL or ApsaraDB for MongoDB instance, DTS automatically adds the DTS server CIDR blocks for the corresponding region to the whitelist of the instance. If the source or destination database is a self-managed database that is hosted on an ECS instance, DTS automatically adds the DTS server CIDR blocks to the security group rules of the ECS instance. You must also make sure that the self-managed database allows access from the ECS instance. If the database is a cluster deployed on multiple ECS instances, you must manually add the DTS server CIDR blocks for the corresponding region to the security group rules of each ECS instance. If the source or destination database is a self-managed database in a data center or a database from another cloud provider, you must manually add the DTS server CIDR blocks for the corresponding region. For more information, 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 the migration types and 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 Amazon RDS for PostgreSQL database during the migration.

    Migration Objects

    In the Available box, click the objects to migrate, and then click 向右小箭头 to move them to the Selected Objects box.

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

    • By default, object names are the same in the source and destination instances. To rename destination objects, use the object name mapping feature. For more information, see Object name mapping.

    • If you use object name mapping, the migration of dependent objects may fail.

    Edit Mapped Name

    To change the name of a migration object in the destination instance, use the object name mapping feature. For more information, see Object name mapping.

    Retry Duration upon Failure

    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 connection retries. We recommend that you set a custom retry duration based on your business needs, or release the DTS instance as soon as the source and destination 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 workloads to the Alibaba Cloud RDS for PostgreSQL instance.