ApsaraDB RDS for PostgreSQL supports exchanging the endpoints of two instances with one click, reducing the time required for endpoint changes when you switch your business traffic from the current instance to a new one.
Prerequisites
The two RDS for PostgreSQL instances that need to exchange endpoints must meet the following conditions:
The instances are in the Running state.
The instances must be under the same Alibaba Cloud account.
The billing method of the instance must be pay-as-you-go or subscription.
The endpoints pf the instances use the same port.
The connection pool (PgBouncer) feature is not enabled for the instances.
Babelfish is not enabled for the instances, which means the minor versions of the instances do not contain
babelfish.
Usage notes
Only endpoints of the same type can be exchanged.
Source endpoint type
Target endpoint type
Internal endpoint
Internal endpoint
Public endpoint
Public endpoint
The IP whitelists of the instances are not exchanged together with the endpoints. We recommend manually synchronizing the IP whitelists before exchanging endpoints.
After an endpoint exchange, the source instance will be in read-only status to ensure data consistency. We recommend using the instance that no longer handles business traffics after the exchange as the source instance, and the other as the target instance.
NoteYou can remove the read-only state of the source instance by changing its
rds_force_trans_ro_non_supparameter tooffafter the exchange. Before doing this, perform thorough validation on your business.
Procedure
Go to the Instances page. Select the region of the source instance in the top navigation bar, and then click the instance ID.
In the left-side navigation pane, click Database Connection.
On the Database Connection page, click Link exchange address.

In the dialog box that appears, click Switch Network Type as needed, and then configure Target Instance Name and Do you want to keep vip, and then click OK.
The system automatically specifies Exchange this instance link address and the corresponding Target link address.
ImportantRetaining the virtual IP address (VIP) can cause DNS cache issues, which extends the exchange time.
Related API
You can exchange instance endpoints by specifying the TargetDBInstanceId and RetainVip parameters of the ModifyDBInstanceConnectionString API operation.