The cloud migration feature of ApsaraDB RDS for PostgreSQL allows you to migrate the data of a self-managed PostgreSQL instance that is deployed on an Elastic Compute Service (ECS) instance to an ApsaraDB RDS for PostgreSQL instance. This topic describes how to configure an ECS security group on a self-managed PostgreSQL instance before a cloud migration to allow an ApsaraDB RDS for PostgreSQL instance to access the self-managed PostgreSQL instance.

Prerequisites

If you want to migrate the data of a self-managed PostgreSQL instance that is deployed on an ECS instance to an ApsaraDB RDS for PostgreSQL instance, you must perform the configurations described in this topic. The ECS instance on which the self-managed PostgreSQL instance is deployed must meet the following requirements:
  • Network requirements:
    • The ECS instance and the RDS instance reside in the same virtual private cloud (VPC).
    • If you want to migrate data over the Internet, the ECS instance is assigned a public IP address.
  • The self-managed PostgreSQL instance runs as expected on the ECS instance.

Procedure

  1. Log on to the ECS console.
  2. In the left-side navigation pane, choose Instances & Images > Instances.
  3. In the top navigation bar, select the region where the ECS instance resides.
  4. Find the ECS instance and click the instance ID.
  5. In the Basic Information section of the Instance Details tab, click the security group link below the Security Group. ECS security group
  6. In the Access Rule section of the Security Group Rules page, click Add Rule on the Inbound tab. Then, add a security group rule. Security group configurations
    The following table describes the parameters in a security group rule.
    Parameter Description
    Protocol Type Set the value to TCP.
    Port Range Specify the port that is used to connect to the self-managed PostgreSQL instance on the ECS instance. You can run the netstat -a grep PGSQL command to query the port.
    Authorization Object
    • If you want to migrate data over an internal network, enter the value of the VPC CIDR Block parameter.
      To view the VPC CIDR block, perform the following operations:
      1. Access RDS Instances, select a region at the top, and then click the ID of the target RDS instance.
      2. In the left-side navigation pane, click Migrate to Cloud. On the page that appears, click the Migration Assessment tab.
      3. In the Select Migration Source step of the configuration wizard, select Self-managed ECS-based PostgreSQL Database or ApsaraDB RDS for PostgreSQL Instance and click Next.
      4. In the Configure Destination Database step of the configuration wizard, view the value of the VPC CIDR Block parameter. VPC CIDR block of an RDS instance
    • If you want to migrate data over the Internet, enter the value of the Public IP Address parameter.
      To view the Public IP address, perform the following operations:
      1. Access RDS Instances, select a region at the top, and then click the ID of the target RDS instance.
      2. In the left-side navigation pane, click Migrate to Cloud. On the page that appears, click the Migration Assessment tab.
      3. In the Select Migration Source step of the configuration wizard, select PostgreSQL migration with public network address (including migrating from other cloud vendors) and click Next.
      4. In the Configure Destination Database step, click Allocated EIP. Allocated EIP
      5. Refresh the page and check the value of the Public IP Address parameter. Public IP Address of an RDS instance

What to do next

Configure the postgresql.conf file of a self-managed PostgreSQL instance