Skip to main content

Perform Aiven for PostgreSQL® switchover to the recovery region Limited availability

Perform a planned promotion of your recovery service while the primary service is healthy.

Switch over to your Aiven for PostgreSQL® recovery service for planned maintenance, simulating a disaster, or testing the resilience of your infrastructure.

Prerequisites

Switch over

Run avn service update to promote the recovery service to active:

avn service update RECOVERY_SERVICE_NAME \
--disaster-recovery-role active

Replace RECOVERY_SERVICE_NAME with the name of the recovery service, for example, pg-demo-recovery.

Verify the switchover by checking both services:

  • Recovery service status:

    avn service get RECOVERY_SERVICE_NAME \
    --json | jq '{state: .state, disaster_recovery_role: .disaster_recovery_role}'

    Expect the following output:

    {
    "state": "RUNNING",
    "disaster_recovery_role": "active"
    }
  • Primary service status:

    avn service get PRIMARY_SERVICE_NAME \
    --json | jq '{state: .state, disaster_recovery_role: .disaster_recovery_role}'

    Expect the following output:

    {
    "state": "RUNNING",
    "disaster_recovery_role": "passive"
    }

After the switchover completes, your primary service is Passive, and the recovery service is Active, which means the recovery service is in control over your workloads.

Related pages