0

I have restored basic backup successfully of Postgres. However, after that I have tried to restore incremental backup of Postgres(it was a couple of write to test table), and it had a couple of WAL files and some WAL files with .backup at the end. I have tried to put them into my pg_wal archive directory, that I'm using in the following restore command at postgresql.conf:

wal_level = replica
max_connections = 100
archive_mode = on
archive_command = 'test ! -f /var/lib/postgresql/16/main/pg_wal/wal_archive/%f && cp %p /var/lib/postgresql/16/main/pg_wal/wal_archive/%f'
restore_command = 'cp /var/lib/postgresql/16/pg_wal/wal_archive/%f %p

After putting them into /var/lib/postgresql/16/pg_wal/wal_archive I have tried to restart a couple times postgresql, however my new added WAL files still was not applied. Worth to mention that it seems like restarts did not trigger recovery mode, as restore_command usually executed from that mode.

Any help or advices is greatly appreciated!

asked Feb 23, 2024 at 16:44

1 Answer 1

1

What you describe is not an incremental backup; what you are trying to do is called "point in time recovery", which you initiate by placing a recovery.signal in the Postgres data directory and restarting the server. There are more details to how that works, which you can find in the docs.

Until the incremental backup/restore functionality makes it to Postgres 17, the only other option is to use pgBackRest.

answered Feb 23, 2024 at 17:00
3
  • Incremental backup has already made it into v17. Commented Feb 26, 2024 at 8:32
  • Yeah byt v17 hasn't made it to the release yet, has it? Commented Feb 26, 2024 at 12:57
  • Right. Perhaps I misunderstood; it sounded like you were saying that it isn't in v17 yet. Commented Feb 26, 2024 at 13:01

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.