...
- PGDATA - path to the postgres cluster data direcory
- PGRESTORE - this is a temporary path we will use for staging the files.
- base.tar.gz - path to a previous baseline backup
- PGWALARCHIVE - path to WAL archive directory
Procedure:
Stop postgres, if it's running
e.g.pg_ctl -D $PGDATA -m smart
Restore the database files from base.tar.gz to $PGRESTORE
gunzip base.tar.gz
tar -xvf base.tar --directory
$PGRESTORE- TBD: SET CORRECT OWNER/PERMISSIONS
- TBD: SETUP RECOVERY.CONF AND PLACE INTO PGRESTORE
- start
$PGRESTORE
Duplicate the permissions from PGDATA to PGRESTORE, including file owner and file permissions, for example
chmod 700 $PGRESTORE
find $PGRESTORE | xargs chown postgres:daemon
- Add a recovery.conf file to $PGDATA. At the very least this should include a 'restore_command' entry (see previous section).
Start postgres
pg_ctl -D $PGRESTORE
start
Troubleshooting
tbd
...
start
Postgres will log it's progress to the standard postgres log file. Outside of the log file, the only way to tell if the restore was successful is that postgres will rename the 'recovery.conf' file to 'recovery.done'.
Filter by label (Content by label) | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|