Azure Database for PostgreSQL LRS to GRS

grajee 346 Reputation points


We setup a Azure Database for PostgreSQL instance with LRS backup in EAST US2. We need the backups available for the CENTRAL US region in the event of a disaster as we need to spin up another instance with the backup from the EAST US2 region.

We realized that with LRS we will not be able to do so and the only way would be to recreate the primary instance with GRS backup. We will create another primary instance with GRS but how can we restore the backup from the previous instance (Instance with LRS backup) and not lose data.

Note that the Instance is a Single Server edition.


Azure Database for PostgreSQL
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. grajee 346 Reputation points

    We used pg_dump & pg_restore to restore the database on an instance with GRS backup.

    Geo-restore is only possible if you provisioned the server with geo-redundant backup storage. If you wish to switch from locally redundant to geo-redundant backups for an existing server, you must take a dump using pg_dump of your existing server and restore it to a newly created server configured with geo-redundant backups.


    1 person found this answer helpful.

  2. Anurag Sharma 17,576 Reputation points

    Hi @grajee , welcome to Microsoft Q&A forum.

    If we understand it correctly you want to take the backup from one Azure PostgreSQL server to another PostgreSQL server (single Server) which has the GRS enabled at the time of creation.

    This can be achieved using Database Migration Service in Azure Portal. As this is online migration there will not be any data loss and once the cutover is done you can start using this new database server if needed. Below article explains the same details step by step.

    Tutorial: Migrate/Upgrade Azure DB for PostgreSQL - Single Server to Azure DB for PostgreSQL - Single Server online using DMS via the Azure portal

    There are other ways as well like creating read replicas, or point-in-time restore but they come with RPOs that vary from 5 mins to more time depending on various factors which I assume is not suitable for your requirements:


    Features that you can use to provide business continuity

    One more advantage of using DMS is you can create the target server first with GRS enabled and then migrate the database.

    Please let us know if this helps or else we can discuss further.


    If answer is helpful please please click on 179938-image.png as it could help other members of the Microsoft Q&A community who have similar questions and are looking for solutions. Thank you for helping to improve Microsoft Q&A