This topic describes how to migrate an ApsaraDB for MongoDB instance to a different zone in the same region. After an instance is migrated to a different zone, the attributes, specifications, and endpoints of the instance remain unchanged.

Prerequisites

  • The instance runs MongoDB 4.2 or earlier and uses local disks.
  • Transparent data encryption (TDE) is disabled for the instance.
  • The source zone and the destination zone belong to the same region.
  • Before you migrate an instance in a virtual private cloud (VPC), make sure that a vSwitch is created for the destination zone. For more information about how to create a vSwitch, see Create and manage a vSwitch.
  • The instance does not have a public endpoint. If you have applied for a public endpoint, you must release the public endpoint before you migrate the instance to a different zone. For more information about how to release a public endpoint, see Release a public endpoint.

Usage notes

  • If the instance resides in a VPC, the destination zone must also belong to the same VPC.
  • The amount of time that is required for the migration varies based on factors such as the network conditions, task queue status, and data volume. We recommend that you migrate the instance during off-peak hours.
  • During the migration, you may experience transient connections that last for 30 seconds. Make sure that your application is configured to automatically reconnect to the instance.
  • After the migration, the virtual IP addresses (VIPs) of the instance change. A sample VIP is 172.16.88.60. If your application is connected to the instance by using an original VIP after the migration, the application disconnects from the instance.
    Note To ensure availability, we recommend that you connect your application to the ApsaraDB for MongoDB instance by using the Uniform Resource Identifier (URI) of the instance. For more information, see Connect to a replica set instance and Connect to a sharded cluster instance.

Supported migration types and scenarios

TypeScenario
Migrate the ApsaraDB for MongoDB instance from one zone to another zoneYou want to migrate the ApsaraDB for MongoDB instance to the zone of a specific Elastic Compute Service (ECS) instance. An ECS instance and an ApsaraDB for MongoDB instance that are deployed in the same zone can communicate over an internal network at low network latency.
Migrate the ApsaraDB for MongoDB instance from one zone to multiple zonesYou want to implement disaster recovery across data centers for the instance.
An ApsaraDB for MongoDB instance that is deployed in a single zone can tolerate server- and rack-level faults. An ApsaraDB for MongoDB instance that is deployed in multiple zones can tolerate data center-level faults. For example, you can deploy the three nodes of a replica set instance in three different zones of the same region. This way, the replica set instance can tolerate data center-level disasters.
Note For more information about the node deployment policies that are supported by replica set instances and sharded cluster instances, see Node deployment policies and Deployment policy for the component nodes in a multi-zone sharded cluster instance.
Migrate the ApsaraDB for MongoDB instance from multiple zones to one zoneYou want to migrate the ApsaraDB for MongoDB instance based on your business requirements.
Migrate the ApsaraDB for MongoDB instance from multiple zones to multiple different zonesYou want to migrate the ApsaraDB for MongoDB instance to multiple different zones that can provide sufficient resources for instance upgrades.

Procedure

  1. Log on to the ApsaraDB for MongoDB console.
  2. In the left-side navigation pane, click Replica Set Instances or Sharded Cluster Instances based on the instance type.
  3. In the upper-left corner of the page, select the resource group and region to which the instance belongs.
  4. Click the ID of an instance, or click More icon in the Actions column corresponding to the instance and select Manage.
  5. In the Basic Information section, click Change Zone next to Zone.
  6. In the Migrate Instance to Other Zone pane, configure the parameters based on the network type of the instance.
    • If the ApsaraDB for MongoDB instance resides in a VPC or runs in hybrid access mode, configure the parameters described in the following table.
      ParameterDescription
      InstanceSet the value to the ID of the current instance.
      Current ZoneSet the value to the current zone ID of the instance.
      Migrate ToThe destination zone.
      Select a VSwitchThe destination vSwitch.
      Migration TimeThe time period for the instance migration. Valid values:
      • Switch Immediately after Migration: ApsaraDB for MongoDB starts the migration immediately after you configure the parameters. Business is switched immediately after the migration task is completed.
      • Switch within Maintenance Window: specifies the time period for the instance migration. You can select the current maintenance window or customize a maintenance window based on your business requirements.
        1. Click Edit next to Switch within Maintenance Window.
        2. In the Specification Information section of the Basic Information page, click Edit next to Maintenance Period. For more information, see Specify a maintenance window.
    • If the ApsaraDB for MongoDB instance resides in the classic network, configure the parameters described in the following table.
      ParameterDescription
      InstanceSet the value to the ID of the current instance.
      Current ZoneSet the value to the current zone ID of the instance.
      Migrate ToThe destination zone.
      Migration TimeThe time period for the instance migration. Valid values:
      • Switch Immediately after Migration: ApsaraDB for MongoDB starts the migration immediately after you configure the parameters. Business is switched immediately after the migration task is completed.
      • Switch within Maintenance Window: specifies the time period for the instance migration. You can select the current maintenance window or customize a maintenance window based on your business requirements.
        1. Click Edit next to Switch within Maintenance Window.
        2. In the Specification Information section of the Basic Information page, click Edit next to Maintenance Period. For more information, see Specify a maintenance window.
  7. Read the prompt and select the check box.
  8. Click Submit.