Following on from this post...

I have a backup generated by pg_basebackup regularly, I would update it through the WAL files.

What is the best way to do it?


See the documentation on point-in-time recovery and WAL archiving for how to manage this.

Short version:

  • Set archive_mode = on in master
  • Set an archive_command in master that stores the WAL archives in a location accessible to the replica
  • Create the replica from a pg_basebackup
  • Create a recovery.conf on the replica that sets a restore_command to fetch the archived WAL. You may also want to set a recovery_target_time if you wish to stop replay at a certain point.
  • Start the replica and let it replay WAL

You may find tools like pgbarman useful as well.

  • There is a tool like pgbarman for windows? – Marcos Sep 15 '15 at 22:49
  • Not that I know of, not on Windows. Most of the PostgreSQL infrastructure continues to focus more on Linux and Mac OS X. Support for Windows may be added to a future version of Barman, I know they're talking about it. In the mean time you'll have to use your own scripts/tools. WAL-E might work on Windows, though, I haven't checked. – Craig Ringer Sep 15 '15 at 22:50
  • Is there a script I can do the restoration? – Marcos Nov 4 '15 at 15:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.