All Products
Search
Document Center

ApsaraDB for MongoDB:Switch the VPC and vSwitch of an instance

Last Updated:Mar 28, 2026

When you restructure your network or move workloads between environments, you may need to move an ApsaraDB for MongoDB instance to a different virtual private cloud (VPC) or vSwitch without migrating your data. This topic describes how to switch the VPC and vSwitch of an instance.

Prerequisites

Before you begin, ensure that you have:

  • An instance that stores data on Enterprise SSDs (ESSDs)

Before you switch

Switching the VPC and vSwitch causes the following changes. Review them before you proceed, and schedule the switch during a low-traffic period to minimize the impact on your workloads.

ChangeImpactAction required
Transient disconnectionThe instance is briefly unavailable during the switchMake sure your application reconnects automatically
VIP changeThe virtual IP (VIP) of the instance changesUse a high-availability connection string URI in your application instead of a hard-coded IP address
DMS and DTS unavailabilityData Management (DMS) and Data Transmission Service (DTS) cannot access the instance until the VIP change completesBoth services resume automatically; no action required. See What is DMS? and What is DTS?
DNS cacheThe Domain Name System (DNS) cache on your client may cause read and write failures after the switchClear the DNS cache on your client promptly after the switch completes, then verify connectivity

Switch the VPC and vSwitch

  1. Go to the Replica Set Instances or Sharded Cluster Instances page. In the top navigation bar, select the region where the instance resides, then click the instance ID.

  2. In the Basic Information section, click Change Virtual Private Cloud next to Network Type.

  3. In the Change Virtual Private Cloud panel, select the target virtual private cloud and vSwitch.

  4. Click OK.

After the switch completes, the instance connects to the new VPC and vSwitch. Clear the DNS cache on your client and verify that your application can connect to the instance.