Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: filled out remaining TBD's

...

  • 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:

  1. Stop postgres, if it's running

    e.g. 
    pg_ctl -D $PGDATA -m smart
  2. Restore the database files from base.tar.gz to $PGRESTORE

    gunzip base.tar.gz 
    tar -xvf base.tar --directory
    $PGRESTORE
  3. TBD: SET CORRECT OWNER/PERMISSIONS
  4. TBD: SETUP RECOVERY.CONF AND PLACE INTO PGRESTORE
  5. start
     $PGRESTORE
  6. Duplicate the permissions from PGDATA to PGRESTORE,  including file owner and file permissions, for example

    chmod 700 $PGRESTORE
    find $PGRESTORE | xargs chown postgres:daemon

     

  7. Add a recovery.conf file to $PGDATA.  At the very least this should include a 'restore_command' entry (see previous section).
  8. Start postgres

    pg_ctl -D $PGRESTORE
    start

 

Troubleshooting 

tbd

 

...

  1.  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)
showLabelsfalse
max5
spacesDEV
sortmodified
showSpacefalse
reversetrue
typepage
labelsdatabase