All Products
Search
Document Center

PolarDB:Manually change the primary or secondary zone

Last Updated:Mar 28, 2026

PolarDB for MySQL lets you move a cluster's compute nodes to a different zone without changing its endpoints. Use this to optimize latency for co-located Elastic Compute Service (ECS) instances, run disaster recovery drills, or rebalance zone distribution.

Choose an operation

Three operations are available. Pick the one that matches your goal:

GoalOperationData migrationService interruption
Move the cluster to a zone where your ECS instances are, or run a disaster recovery drill when the target is already a secondary zoneChange the primary zoneNo (compute nodes only, ~5 min per node)1–2 transient connections, ~30s each
Move the cluster to a zone where your ECS instances are, when the target is not a secondary zoneChange the primary zoneYes (duration depends on data volume)1–2 transient connections, ~30s each
Rebalance secondary zone placementChange the secondary zoneYes (duration depends on data volume)
Perform a primary/secondary switchover to the hot standby storage clusterSwitch to the hot standby storage clusterNo1–2 transient connections, ~30s each

Prerequisites

Before you begin, make sure that:

  • Resources in your region are deployed across two or more zones. Multi-zone deployment is unavailable in the following regions: Philippines (Manila), South Korea (Seoul), China (Qingdao), China (Chengdu), China (Hohhot), and Thailand (Bangkok).

  • For hot standby storage cluster switchover: the hot standby storage cluster feature is enabled on your cluster. See High-availability mode (hot standby storage cluster).

Change the primary zone

Changing the primary zone migrates the cluster's compute nodes to the destination zone. The primary endpoint and cluster endpoints remain unchanged after the operation, but the vSwitch and IP address may change.

Important

Schedule this operation during off-peak hours. One or two transient connections occur during the switchover, each lasting approximately 30 seconds. Make sure your application can automatically reconnect to the database.

Important

If the destination zone is not a current secondary zone, data migration is required. Migration time depends on data volume and may take several hours for large datasets. Proceed with caution.

  1. Log on to the PolarDB console.

  2. In the upper-left corner, select the region where the cluster is deployed.

  3. Find the cluster and click its ID.

  4. At the bottom of the Basic Information page, click Migrate Cluster Across Zones.

    Migrate cluster across zones

  5. In the dialog box, configure the following parameters:

    ParameterDescription
    Destination ZoneThe target zone for the cluster. If the zone is already a secondary zone, only compute nodes are migrated (~5 min per node). Otherwise, data migration is required.
    Destination VPCThe VPC in the destination zone.
    Destination vSwitchThe vSwitch in the destination VPC. If no vSwitches are available, create one first. See Create and manage a vSwitch.
    Validity PeriodSet to Immediately to run at once, or Upgrade in Maintenance Window to schedule during the maintenance window. To view or cancel a scheduled task, see Scheduled tasks.
  6. Click OK.

Change the secondary zone

Changing the secondary zone migrates data from the original secondary zone to the destination zone. The destination zone cannot be the current primary or secondary zone.

Important

Data migration is always required when changing the secondary zone. Migration time depends on data volume and may take several hours for large datasets. Schedule this operation during off-peak hours.

  1. Log on to the PolarDB console.

  2. In the upper-left corner, select the region where the cluster is deployed.

  3. Find the cluster and click its ID.

  4. In the left-side navigation pane, choose Settings and Management > Service Availability.

  5. On the Service Availability page, click Change Secondary Zone.

    Change secondary zone button

  6. In the dialog box, select the destination zone and configure the Effective Time parameter:

    • Effective Immediately: Runs the operation immediately.

    • Effective in Maintenance Window: Schedules the operation during the maintenance window. To view or cancel a scheduled task, see Scheduled tasks.

    Effective Time parameter options

  7. Click OK.

Switch to the hot standby storage cluster

This operation performs a primary/secondary switchover to the hot standby storage cluster. After the switchover, the primary endpoint, cluster endpoint, vSwitch, and IP address remain unchanged, but indirect accesses may occur. Proceed with caution.

Important

Avoid switching between the primary cluster and the hot standby storage cluster frequently. Frequent switching can cause high replication latency.

This operation is supported for Standard Edition and Cluster Edition clusters only. You can switch over to the hot standby storage cluster only — switching to a non-secondary zone is not supported.
  1. Log on to the PolarDB console.

  2. In the upper-left corner, select the region where the cluster is deployed.

  3. Find the cluster and click its ID.

  4. In the left-side navigation pane, choose Settings and Management > Service Availability.

  5. On the Service Availability page, click Switch Over to Hot Standby Storage Cluster.

  6. Click OK.

FAQ

Does changing the primary zone cause extended service downtime?

No. The migration time (5 minutes per compute node, or hours for data migration) is not service downtime. Only one or two transient connections occur during the actual switchover, each lasting approximately 30 seconds. Schedule the change during off-peak hours and make sure your application reconnects automatically.

Primary zone change process diagram

What happens to my endpoints after changing the primary zone?

The primary endpoint and cluster endpoints remain unchanged, so existing connections continue to work. The vSwitch and IP address may change, which can briefly affect availability. Plan the change during a maintenance window to minimize impact.