All Products
Search
Document Center

ApsaraDB for MongoDB:Migrate an instance across zones

Last Updated:Mar 28, 2026

Migrate an ApsaraDB for MongoDB instance to a different zone in the same region. The instance's connection address and account password remain unchanged after the migration.

Important

The virtual IP address (VIP) of the instance changes after migration. If your application connects using a VIP (for example, 172.16.88.60) instead of a connection string URI, connections will fail. Before you begin, confirm that your application uses the connection string URI. For replica set instances, see Connect to a replica set instance. For sharded cluster instances, see Connect to a sharded cluster instance.

Prerequisites

Before you begin, make sure that:

  • Your instance meets one of the following requirements:

    • The instance is a replica set or sharded cluster instance that uses local disks and runs MongoDB 4.0 or 4.2.

    • The instance is a replica set or sharded cluster instance that uses cloud disks and runs MongoDB 4.4 or later.4.4

  • Transparent Data Encryption (TDE) is disabled for the instance.

  • The destination zone is in the same region as the current zone.

  • If your instance is in a virtual private cloud (VPC), a vSwitch already exists in the destination zone. For details, see Create and manage vSwitches.

  • If your instance uses local disks and has a public endpoint, release the public endpoint before migrating. For details, see Release a public endpoint.

Usage notes

  • VPC cannot be changed. You cannot change the VPC during migration.

  • Schedule during off-peak hours. Migration time varies based on network conditions, the task queue, and data volume.

  • Expect a brief connection interruption. The switchover causes a transient connection interruption of approximately 30 seconds. Make sure your application has an automatic reconnection mechanism.

Choose a migration type

Select the migration type based on your disaster recovery (DR) goal or operational need:

Migration typeWhen to use
Single zone to another single zoneCo-locate the instance with ECS instances in the same zone to reduce internal network latency.
Single zone to multiple zonesSurvive data center-level failures. A single-zone instance tolerates server-level and rack-level failures only. Spreading replica set nodes across three zones in the same region achieves data center-level fault tolerance. For more information about node deployment policies for multi-zone instances, see Node deployment policies or Create a multi-zone sharded cluster instance.
Multiple zones to a single zoneMeet the requirements of a specific feature that does not support multi-zone deployment.
Multiple zones to another set of multiple zonesProvide more resources when the current multi-zone layout cannot accommodate a new instance specification.
Important
  • Local disk instances can only migrate from one single zone to another single zone. Multi-zone deployment for local disk instances requires a zone in the Region (Zone 1+Zone 2+Zone 3) format, such as Shenzhen (C+D+E). This format is available only in some regions. For details, see Available regions and zones.

  • Cloud disk instances support changing the instance type during zone migration.

Migrate the instance

  1. Go to the MongoDB Replica Set Instances or MongoDB Sharded Cluster Instances page. In the upper part of the page, select a resource group and a region, then click the ID of the instance.

  2. In the Basic Information section, click Cross-zone Migration to the right of Zone.

  3. In the Migrate Instance Across Zones panel, configure the parameters.

    The parameters vary based on the disk type of the instance.

    Cloud disk

    ParameterDescription
    InstanceThe ID of the current instance.
    Current ZoneThe zone where the instance currently resides.
    Deployment TypeSelect Single-zone or Multi-zone.
    Migrate ToSelect the destination zone. If you select Multi-zone, also configure Migrate Data from Secondary Zone 1 to and Migrate Data from Secondary Zone 2 to.
    Current VPCThe VPC to which the instance currently belongs.
    Select vSwitchSelect the destination vSwitch.
    Switchover TimeSelect when the migration takes effect: Switch Immediately after Migration starts the switchover as soon as the migration task completes. Switch within Maintenance Window defers the switchover to a scheduled window. To set the window, click Edit next to this option. For details, see Set a maintenance window.

    Local disk

    The parameters vary based on the network type of the instance.

    • Local disk — VPC or hybrid access

      ParameterDescription
      Instance ID/NameThe ID of the current instance.
      Instance NetworkThe VPC and vSwitch in which the instance currently resides.
      Destination ZoneSelect the destination zone and vSwitch.
      Switchover TimeSelect when the migration takes effect: Switch Immediately after Migration starts the switchover as soon as the migration task completes. Switch within Maintenance Window defers the switchover to a scheduled window. To set the window, click Edit next to this option. For details, see Set a maintenance window.
    • Local disk — classic network

      ParameterDescription
      InstanceThe ID of the current instance.
      Current ZoneThe zone where the instance currently resides.
      Migrate ToSelect the destination zone.
      Switchover TimeSelect when the migration takes effect: Switch Immediately after Migration starts the switchover as soon as the migration task completes. Switch within Maintenance Window defers the switchover to a scheduled window. To set the window, click Edit next to this option. In the Instance Specifications section, click Edit next to Maintenance Window to configure the window. For details, see Set a maintenance window.
  4. Read the on-screen instructions and select the confirmation check box.

  5. Click OK.

FAQ

Can I migrate a cloud disk instance with disk encryption enabled?

Yes. Zone migration is supported for instances with disk encryption enabled.