This topic describes how to switch the network type of an ApsaraDB for MongoDB instance from classic network to virtual private cloud (VPC) by using the console or by calling the relevant API operation. When you switch the network type, you can specify a period during which you want to retain the classic network endpoint of the instance. After the retention period expires, the classic network endpoint is automatically deleted.
- The network type is classic network.
- The instance must be an ApsaraDB for MongoDB replica set instance.
- VPCs and vSwitches are available in the zone to which the ApsaraDB for MongoDB instance belongs. For more information, see Create an IPv4 VPC.
Switch the network type by using the console
- Log on to the ApsaraDB for MongoDB console.
- Find the ApsaraDB for MongoDB instance that you want to manage and click its ID.
- In the left-side navigation pane, click Database Connection, and then click Switch to VPC.
- In the Create Alert panel, perform the following steps:
- Select the VPC and vSwitch that you want to use.
- You can choose to retain the classic network endpoint and specify a retention period.
Note If you choose to retain the classic network endpoint, ECS instances in a classic network can still access the database. When the retention period expires, the classic endpoint is automatically deleted and you can no longer access the database through the classic network endpoint.
- Click OK.
- On the Database Connection page, you can view the classic network and VPC endpoints.