This topic describes how to switch an ApsaraDB RDS for PostgreSQL instance to a different vSwitch based on your business requirements in the ApsaraDB RDS console or by calling an API operation.
Prerequisites
The RDS instance uses standard SSDs or enhanced SSDs (ESSDs).
Impacts
When you switch your RDS instance to a different vSwitch, a transient connection that lasts approximately 30 seconds occurs. Make sure that your application is configured to automatically reconnect to your RDS instance.
After you switch your RDS instance to a different vSwitch, the virtual IP address (VIP) of your RDS instance changes. We recommend that you connect your application to your RDS instance by using an endpoint. For more information, see Configure endpoints.
The VIP change interrupts the connection between your RDS instance and Data Management (DMS) and the connection between your RDS instance and Data Transmission Service (DTS) for a short period of time. After you switch your RDS instance to a different vSwitch and the VIP of the RDS instance is changed, the connections are automatically resumed.
If data is cached on your database client, you can read data but cannot write data. After you switch your RDS instance to a different vSwitch, we recommend that you immediately clear the cache on the database client.
Procedure
You cannot change the virtual private cloud (VPC) of an RDS instance. You can create an RDS instance that resides in the required VPC. Then, migrate the data of the original RDS instance to the new RDS instance. For more information, see Use the cloud migration feature to migrate data between ApsaraDB RDS for PostgreSQL instances or Use DTS to migrate data between ApsaraDB RDS for PostgreSQL instances.
- 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.
In the left-side navigation pane, click Database Connection.
Click Switch vSwitch.
Select the required vSwitch and click OK.
In the dialog box that appears, click OK.
FAQ
How do I change the VPC of an RDS instance?
You cannot directly change the VPC of an RDS instance. You can create an RDS instance that resides in the required VPC. Then, migrate the data of the original RDS instance to the new RDS instance. For more information, see Use the cloud migration feature to migrate data between ApsaraDB RDS for PostgreSQL instances or Use DTS to migrate data between ApsaraDB RDS for PostgreSQL instances.
References
For more information about how to switch an RDS instance to the vSwitch that belongs to a different zone, see Migrate an ApsaraDB RDS for PostgreSQL instance across zones in the same region.
You can switch an RDS instance to a different vSwitch by calling the SwitchDBInstanceVpc operation. The following table describes the operation.
Operation
Description
Switches an instance that uses standard SSDs or ESSDs to a different vSwitch.
NoteYou cannot directly change the VPC of an RDS instance. You must set the VPCId parameter to the VPC of the current RDS instance.