1

I see another questions about this but not clear or working for me.

I have one database PostgreSQL 12 version. I made one general backup approx 3 month ago, then turned on the WAL archive.

Here is my config file ( some important pieces):

max_connections = 100
archive mode = on
wal_level = replica
max_wal_size = 1GB
min_wal_size = 80MB
archive_command = 'copy "%p" "C:\\Backup\\wal files\\%f"'
restore_command = 'copy  "C:\\Backup\\wal files\\%f" "%p"'
recovery_target_timeline = 'latest'
max_wal_senders = 10
wal_sender_timeout = 900s

The first issue, how the archive_command some reason not copy the WAL files to the desired directory. I found only in the pg_wal folder. I try to use \ and double \ . Another database server works...

My server stopped compeletly, new server arrived installed. And the old backup file restored. pg_restore.

Now, how can I restore the WAL files? I try the pg_waldump.

pg_waldump C:\Program Files\postgresql\12\data\pg_wal\0000000100000007000000F2 > D:\Backup\Ready\walbackupfile

And get back to me error message how the wal file not found. But hte file is there, and the name is correct also. I try to copy, and many another way, but not works.

Any idea helps.

  • `how the archive_command some reason not copy the WAL files` - we can't tell you that, can we? What do your logs say - you should be getting one log entry every time it fails. Also you seem to be mixing up pg_dump/pg_restore backups with WAL archive backups - they are completely different things for different use cases. – Richard Huxton Jun 28 '23 at 08:10
  • Thank you for your suppport. In my mind the way how I restore the WAL files is: First I need to restore my general backup file. Second I need to convert the WAL files to one backup file and restore. MAybe I know wrong? – Mr.Database Jun 28 '23 at 09:08
  • You've got completely the wrong idea I'm afraid. Read a couple of articles on pg_dump/pg_restore backups and WAL archiving to get it straight in your head. Anything linked from planet.postgresql.org is a reliable article and the official docs are good reference but not really a tutorial – Richard Huxton Jun 28 '23 at 09:11
  • You have to enable WAL archiving *before* you take the backup. If WAL archiving doesn't work, look at the PostgreSQL log file to see why. – Laurenz Albe Jun 28 '23 at 09:18

0 Answers0