All Products
Document Center

ApsaraDB for MongoDB:Switch the network type of an ApsaraDB for MongoDB instance from classic network to VPC

Last Updated:Feb 18, 2024

ApsaraDB for MongoDB supports two network types: classic network and Virtual Private Cloud (VPC). If your ApsaraDB for MongoDB instance resides in the classic network, you can switch the network type of the instance to VPC to enhance network security. This topic describes how to switch the network type of an ApsaraDB for MongoDB instance from classic network to VPC.


The instance runs MongoDB 4.2 or earlier and uses local disks.


The network type of standalone instances is always VPC and cannot be changed.

Background information

  • Classic network endpoint: Classic network endpoints are used for communication over the classic network. In the classic network, Alibaba Cloud services are not isolated. To block unauthorized traffic, you must configure security groups or IP address whitelists.

  • VPC endpoint: VPC endpoints are used for communication over VPCs. A VPC is an isolated network that provides higher security and performance than the classic network. By default, ApsaraDB for MongoDB provides VPC endpoints for instances to ensure high security and performance.

Usage notes

When you switch the network type of an ApsaraDB for MongoDB instance, a transient connection may occur on the instance. We recommend that you perform this operation during off-peak hours or make sure that your application is configured to automatically reconnect to the instance after it is disconnected. This prevents service interruptions.


  1. Create a VPC in the same region as the ApsaraDB for MongoDB instance that you want to manage. For more information, see Create and manage a VPC.

  2. Log on to the ApsaraDB for MongoDB console.

  3. In the left-side navigation pane, click Replica Set Instances or Sharded Cluster Instances.

  4. In the upper-left corner of the page, select the resource group and region to which the instance belongs.

  5. Click the ID of the instance or find the instance and click Manage in the Actions column.

  6. In the left-side navigation pane of the page that appears, click Database Connections.

  7. In the Internal Connections section, click Switch to VPC.

  8. In the VPC panel, configure the parameters described in the following table.




    Select the ID of the VPC created in Step 1.


    Select the ID of the vSwitch created in Step 1.

    Retain the connection address of the classic network

    Specify whether to retain the original classic network endpoint of the ApsaraDB for MongoDB instance.

  9. Click OK.