All Products
Search
Document Center

:Change the vSwitch of an ApsaraDB RDS instance

Last Updated:Feb 28, 2026

Applies to: ApsaraDB RDS for MySQL | ApsaraDB RDS for SQL Server | ApsaraDB RDS for PostgreSQL | ApsaraDB RDS for MariaDB

You can change the VPC and vSwitch of an ApsaraDB RDS instance directly from the console or by using the SwitchDBInstanceVpc API. If direct change is not available for your instance, use one of the alternative methods.

Before you begin

  • Create a snapshot or enable log backup before modifying network configurations.

  • The direct change method supports subscription and pay-as-you-go instances. Serverless instances are not supported.

  • For instances that use cloud disks, the minor engine version must be 20201031 or later to change the VPC. For more information, see Update the minor engine version.

  • The target VPC must reside in the same region as the RDS instance.

Impacts

When you change the VPC and vSwitch of an RDS instance:

  • An instance switchover occurs. Make sure that your application supports automatic reconnection.

  • The virtual IP addresses (VIPs) of the instance change. Connect your application by using an endpoint instead of an IP address.

  • DMS and DTS connections are briefly interrupted and then automatically resumed.

Method 1: Change the vSwitch directly (recommended)

This method is supported for ApsaraDB RDS for MySQL, SQL Server, and PostgreSQL instances.

  1. Go to the Instances page. In the top navigation bar, select the region of the RDS instance. Click the instance ID.

  2. In the left-side navigation pane, click Database Connection.

  3. Click Switch vSwitch.

  4. Select the target VPC and vSwitch, and then click OK.

  5. In the confirmation message, click OK.

For detailed instructions per engine, see:

Method 2: Change the vSwitch through network type switching

If your RDS instance supports switching between VPC and classic network, change the vSwitch through a two-step network type switch:

  1. Switch the network type from VPC to classic network.

  2. Switch the network type from classic network back to VPC. During this step, select the target VPC and vSwitch.

See Change the network type of an ApsaraDB RDS for MySQL instance.

Note

This method requires the instance to support both VPC-to-classic network and classic network-to-VPC switching.

Method 3: Create a new instance and migrate data

If neither Method 1 nor Method 2 is available for your instance (for example, ApsaraDB RDS for MariaDB instances), purchase a new instance with the target vSwitch and migrate your data:

Related API operations

OperationDescription
SwitchDBInstanceVpcChanges the VPC and vSwitch for an ApsaraDB RDS instance.
ModifyDBInstanceNetworkTypeChanges the network type of an ApsaraDB RDS instance.