PostgreSQL Restore – How to Restore from Base Backup with wal-e

backuppostgresqlpostgresql-9.6restore

I have a postgres base backup taken via wal-e. Is it possible to restore and start the DB with just the base backup? I cannot use the restore_command in recovery.conf since the wal files are archived to deep glacier.

After copying the base backup with wal-e backup-fetch command and starting the DB, im getting the following logs:

2019-11-05 11:28:26 UTC [7417]: user=,db=,app=,client= LOG:  database system was interrupted; last known up at 2019-10-31 22:13:32 UTC
2019-11-05 11:28:26 UTC [7417]: user=,db=,app=,client= LOG:  creating missing WAL directory "pg_xlog/archive_status"
2019-11-05 11:28:26 UTC [7417]: user=,db=,app=,client= LOG:  invalid checkpoint record
2019-11-05 11:28:26 UTC [7417]: user=,db=,app=,client= FATAL:  could not locate required checkpoint record
2019-11-05 11:28:26 UTC [7417]: user=,db=,app=,client= HINT:  If you are not restoring from a backup, try removing the file "/var/lib/postgresql/9.6/main/backup_label".
2019-11-05 11:28:26 UTC [7415]: user=,db=,app=,client= LOG:  startup process (PID 7417) exited with exit code 1
2019-11-05 11:28:26 UTC [7415]: user=,db=,app=,client= LOG:  aborting startup due to startup process failure
2019-11-05 11:28:26 UTC [7415]: user=,db=,app=,client= LOG:  database system is shut down

Is it possible to start the DB and bring it to consistent state with only the base backup?

Best Answer

I have a postgres base backup taken via wal-e.

So I would suggest that your question would be best addressed to the people who created wal-e. I've never used it myself, but ...

Is it possible to start the DB and bring it to consistent state with only the base backup?

Short answer: No.

The base backup takes a "snapshot" of the database. That snapshot, taken from a running database, it unlikely to be consistent in itself.

Anything and everything that happens in the database after that snapshot is taken is written to the WAL files so, in order to do any meaningful database recovery, you need those as well.