All Products
Search
Document Center

ApsaraDB RDS:One-click cloud migration

Last Updated:Jun 20, 2026

This feature uses physical streaming replication for a fast, simple, and reliable migration that supports a wide range of scenarios and improves migration efficiency.

Prerequisites

  • The target ApsaraDB RDS for PostgreSQL instance must meet these requirements:

    • The major version of the instance must match that of your self-managed PostgreSQL database. PostgreSQL 10 and later versions are supported.

      Note

      To migrate across major versions, such as from PostgreSQL 10 to ApsaraDB RDS for PostgreSQL 13, you must first complete the one-click cloud migration described in this topic. Then, you can upgrade the major version of the database from ApsaraDB RDS for PostgreSQL 10 to 13.

    • The instance must be a primary instance. read-only instances do not support one-click cloud migration.

    • The instance's storage type must be cloud disk.

    • The instance is empty and has available storage space greater than or equal to the data size of your self-managed PostgreSQL database.

  • Your self-managed PostgreSQL database must meet these requirements:

Notes

During the cloud migration task, you can read from and write to your self-managed PostgreSQL database. However, do not perform major administrative operations such as another migration, a restart, or a specification change.

Step 1: Run a feasibility evaluation

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.

  2. In the left-side navigation pane, click Cloud Migration/DR Deployment, and then click the Feasibility Assessment tab.

  3. On the Configure Scenario and Source Type page of the wizard, set Migration to Cloud to Cloud Migration, select your migration source, and click Next.

  4. On the Configure Destination Instance page, click Next.

  5. On the Configure Source Instance page, select the checkboxes for all the prerequisite configurations you have completed, and then click Next.

    Note

    For more information about the items on the Configure Source Instance page, see (Optional) Configure an ECS security group, Create a migration account, and Update the pg_hba.conf file.

  6. On the Start Feasibility Assessment page, configure the source instance information.

    Parameter

    Description

    Migration Task Name

    Auto-generated. No changes are required.

    Source VPC/DNS IP

    • If the source database is on an ECS instance, enter the private IP of the ECS instance. For more information, see View IP addresses.

    • If the source database is in an on-premises data center, enter the private IP of the data center.

    Port of Source Instance

    The port of your self-managed PostgreSQL database. You can run the netstat -a | grep PGSQL command to view the port.

    Username

    migratetest. This is the database account created in the Create a migration account step.

    Password

    123456. This is the password for the database account created in the Create a migration account step.

  7. Click Create Feasibility Assessment Task.

    Note

    During the feasibility evaluation, the instance status changes to Maintaining Instance.

    After the evaluation is complete, you can view the task status in the Migration to Cloud list on the Feasibility Assessment tab.

    After you resolve the error, click Re-assess in the Actions column to start the evaluation task again.

Step 2: Start the cloud migration

Note

You can perform this step only after the feasibility evaluation is successful.

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.

  2. In the left-side navigation pane, click One-Click Cloud Migration/Disaster Recovery, go to the Migration to Cloud tab, and click Create Cloud Migration Task.

  3. In the Create Cloud Migration Task window, select the successful evaluation task from the Associated Assessment Task list. This task is the one that you created in Step 1: Run a feasibility evaluation.

    Note

    After you select an Associated Assessment Task, the Migration Source Type, Source IP/ DNS, Port of Source Instance, and Username parameters are automatically populated.

  4. Click Initiate Migration to Cloud. The system automatically starts the cloud migration task.

    Warning

    During the cloud migration, the instance status changes to Migrating Data In. You can perform read and write operations on your self-managed PostgreSQL database. However, do not perform major administrative operations such as another migration, a restart, or a specification change. Otherwise, the cloud migration task will fail.

  5. Perform the cutover.

    1. In the cloud migration task list, click the link in the Cloud Migration Phase column to check the progress of the task.

    2. When the cloud migration phase is Incremental Data Synchronization, click Switchover in the Action column to begin the cutover.

    3. In the Switchover window, follow the cutover instructions: set the source instance to read-only or stop write operations from your application. Confirm that the replication status is streaming and select the checkboxes for the other instructions: the superuser is demoted to rds_superuser, and the passwords for the aurora and replicator accounts are reset and used as RDS system accounts. After you confirm, click Switch Now.

      Note

      Set the source instance to read-only:

      • If the source instance is an ApsaraDB RDS for PostgreSQL instance, follow these steps:

        1. In Configure instance parameters, set the rds_force_trans_ro_non_sup parameter of the source instance to on.

        2. Run the following statement to terminate all existing sessions.

          SELECT pg_terminate_backend(pid) FROM pg_stat_activity 
          WHERE usename not in ('replicator', 'monitor', 'pgsql', 'aurora') AND pid != pg_backend_pid();
      • If the source instance is a self-managed database, follow these steps:

        -- Set the database to read-only.
        ALTER SYSTEM SET default_transaction_read_only=on;
        -- Reload the parameter configuration to apply the change.
        SELECT pg_reload_conf();
        -- Terminate all existing sessions.
        SELECT pg_terminate_backend(pid) FROM pg_stat_activity 
        WHERE usename not in ('replicator', 'monitor', 'pgsql', 'aurora') AND pid != pg_backend_pid();
    4. Select all checkboxes and click Switch Now. Then, wait for the migration to complete.

    After the migration is complete, the Cloud Migration Phase column displays Completed, and the Task Status column displays Successful.