Home > database >  Can I set up Wal Archiving on a three years old Postgres database?
Can I set up Wal Archiving on a three years old Postgres database?

Time:02-10

If I set up Wal Archiving on a three years old Postgres database (used in production); do the Continuous Archiving and Point-in-Time Recovery (PITR) will work from the beginning? Will I have all the data?

For example: So if I enabled wal archiving 3 days ago, and I want to restore to yesterday. Will I have all the data from the beginning? Or only the data from 3 days ago to yesterday?

CodePudding user response:

You need a valid base backup to go with your WAL archive, which is slightly newer than the archive is but is older than yesterday. If you have that and restore to yesterday, then data from two years ago which was deleted today will be there, as it was present yesterday. Data from two years ago deleted 5 days ago will of course not be there.

  • Related