I need to take incremental backup of Postgres DB. I need to capture (backup of) daily changes on a database. So that I can restore DB with any particular data I want.
As per Continuous Archiving, I am doing below steps:
- I configured
postgresql.conf, and addedwal_level,archive_modeandarchive_command - Restart server
- Added some data
pg_start_backup('label');- Take backup of data dir
pg_stop_backup();- Added more data
- Take backup of wal dir and
pg_xlogdir - Replace backup data (from step 5) in data dir
- Start server
- Copy
pg_xlog(from step 8) in currentpg_xlogdir - Added
recovery.confand addedrestore_command - Restart DB
Now I want data which I added in step 7. (I had taken backup of WAL file and pg_xlog at that time). So I consider this data as a backup of a particuar day. And I want to restore my database with this date's data.
Now If I replace those files ie. WAL and pg_xlog and recreate recovery.conf and restart db, I do not get the data in step 7, still old one.
Please let me know if I am missing anything.