Edit

Share via


Switch over read replica to primary

APPLIES TO: Azure Database for PostgreSQL - Flexible Server

This article provides step-by-step instructions to switch over a read replica of an Azure Database for PostgreSQL flexible server so that it becomes the new primary server of the replication set.

Steps to switch over read replica to primary

Using the Azure portal:

  1. Select the Azure Database for PostgreSQL flexible server for which you want to show its associated virtual endpoints.

  2. In the resource menu, under the Settings section, select Replication.

    Screenshot showing the Replication page with read replicas.

  3. Select the Promote icon to the side of the name of the endpoint of the read replica to which you want to switch over.

    Screenshot showing the location of the Promore action in the Replication page.

  4. If the server doesn't have the virtual endpoints created, or if the read replica which you're trying to switch over to primary isn't the reader virtual endpoint's target server, an attempt to switch over a read replica to primary fails. That's what the warning displayed in the dialog reminds you.

    Screenshot showing the Switch over or Promote to standalone pane when there aren't virtual endpoints or aren't correctly configured to support the switch over operation.

  5. In Replica server to promote, select Promote to primary server for Action. And select Planned or Forced for Data sync, depending on what suits your needs best. if you decide to use the Forced option, you have to mark the I understand that any data changes that have not been replicated from the primary server will be lost. The read replica lag time is the approximate period of data loss. checkbox to acknowledge the potential data loss. Finally, select Promote.

    Screenshot showing the Switch over or Promote to standalone pane.

  6. A notification informs you that the read replica is being switched over to primary.

    Screenshot showing a notification informing that the read replica is being switched over to primary.

  7. When the process completes, a notification informs you that the read replica successfully switched over to primary.

    Screenshot showing a notification informing that the read replica switched over to primary successfully.