All Products
Search
Document Center

PolarDB:Change the VPC and vSwitch

Last Updated:Mar 28, 2026

PolarDB for MySQL Enterprise Edition lets you switch the Virtual Private Cloud (VPC) and vSwitch online while the cluster stays in the same zone. The cluster endpoint remains unchanged after the switch.

If your Elastic Compute Service (ECS) instance and the PolarDB cluster are in different VPCs, they cannot communicate over a private network. Move the cluster to the same VPC as your ECS instance to enable private network connectivity.

Prerequisites

Before you begin, make sure your cluster meets all of the following conditions:

  • Database Edition: Enterprise Edition (set at cluster creation)

  • Edition: Cluster Edition (set at cluster creation)

  • Billing method: Subscription or Pay-as-you-go

Limitations

  • You cannot switch the VPC and vSwitch of the primary endpoint or a cluster endpoint individually. Only custom endpoints support individual VPC and vSwitch changes.

  • The cluster's zone cannot be changed by this operation.

Before you switch: understand what changes and what doesn't

Switching the default VPC does not automatically move all existing custom endpoints. Use the Existing Endpoint Switching option to control this behavior:

SettingEffect
No (default)Only the default VPC and default vSwitch are updated. Existing custom endpoints keep their current VPC and vSwitch settings.
YesThe default VPC and default vSwitch are updated, and all existing custom endpoints move to the new VPC and vSwitch.
Note

The default VPC and default vSwitch are pre-selected when you create a custom endpoint. If you select a different VPC or vSwitch at endpoint creation, the cluster's default VPC and vSwitch are updated to match.

Impact of the switch

ImpactDetails
Transient connection interruptionA connection interruption of approximately 30 seconds occurs during the switch. Perform the switch during off-peak hours and configure your application to reconnect automatically.
DNS cacheAfter the switch, stale endpoint information may remain in the DNS cache until entries expire, causing connection failures. Restart the application or flush the DNS cache on the host to resolve this.
DMS and DTS connectionsConnections to Data Management (DMS) and Data Transmission Service (DTS) are briefly interrupted. Both resume automatically once the cluster connects to the new VPC and vSwitch.

Change the default VPC and vSwitch

  1. Log on to the PolarDB console. In the left-side navigation pane, click Clusters. Select the region where the cluster resides, then click the cluster ID to go to the Basic Information page.

  2. On the Basic Information page, click Switch next to Default VPC. In the Switch VPC dialog box, select the target VPC and vSwitch.

    Important

    If you select No for Existing Endpoint Switching, existing custom endpoints are not moved to the new VPC and vSwitch.

    image

Change the VPC and vSwitch of a custom endpoint

  1. Log on to the PolarDB console. In the left-side navigation pane, click Clusters. Select the region where the cluster resides, then click the cluster ID to go to the Basic Information page.

  2. In the Database Connections section, select a custom endpoint. In the Modify Endpoint Settings dialog box, choose More > Edit. imageimage

  3. In the Modify Private Endpoint dialog box, select the target VPC and vSwitch.

    image

Specify the VPC and vSwitch when creating a custom endpoint

  1. Log on to the PolarDB console. In the left-side navigation pane, click Clusters. Select the region where the cluster resides, then click the cluster ID to go to the Basic Information page.

  2. In the Database Connections section, click Create Custom Cluster Endpoint. In the Create Custom Cluster Endpoint dialog box, select the target VPC and vSwitch.

    Important

    The cluster's default VPC and default vSwitch are pre-selected. If you select a different VPC or vSwitch, the cluster's default VPC and default vSwitch are updated to match after the endpoint is created.

    image

    image