pitrery

Point In Time Recovery tools for PostgreSQL

Upgrade to 2.2

Upgrade to 2.1

Nothing to do.

Upgrade to 2.0

Upgrade to 1.13

Nothing to do.

Upgrade to 1.12

Ensure the new name of archiving compression parameters are used, older names are no longer supported. See 1.9 upgrade instructions.

Upgrade to 1.11

Nothing to do.

Upgrade to 1.10

Nothing to do.

Upgrade to 1.9

WAL files archiving and restoring

The following configuration parameters have been renamed :

The safest way to update the configuration file on a running system is to :

Restore

When they differ from the configuration file, options to restore_xlog must be passed using a full custom restore command, with the -r option.

Upgrade to 1.8

Backup

When using the “rsync” storage method, the directory tree of the previous backup is duplicated using hardlinks for files, before rsync’ing over the new tree. The duplication can be done using cp -rl or pax -rwl. This make pitrery more portable on non-GNU systems. The tool can be chosen at build time, GNU cp staying the default.

When using this method over SSH, pax may be required on the target host.

Upgrade to 1.7

Usage

Configuration

The following new configuration variables may be used, here are their defaults:

Upgrade to 1.6

RPM Package

Upgrade to 1.5

Configuration

The following new configuration variables may be used, here are their defaults:

Archiving

Compression options are only available in the configuration file, customising this forces to use -C option of archive_xlog.

Upgrade to 1.4

Archiving

As of 1.4, the archive_xlog.conf files is no longer used to configure archive_xlog. All parameter are now in pitr.conf.

To upgrade, you need to merge your configuration into a pitr.conf file. The default one is available in DOCDIR (/usr/local/share/doc/pitrery by default), comments should be enough to help you reconfigure archive_xlog.

The archive_command should be updated to have archive_xlog search for the configuration file, -C option accept the basename of the configuration file name and searches in the configuration directory, a full path is also accepted:

archive_command = 'archive_xlog -C mypitr %p'

Upgrade to 1.3

Archiving

As of 1.3, pitrery no longer archive more than one file. Thus archive_nodes.conf file has been removed. The archive_xlog script now archives only one file.

If you are archiving more than one time, you have to chain archiving in the archive_command parameter of postgresql.conf:

archive_command = 'archive_xlog -C archive_xlog %p && rsync -az %p standby:/path/to/archives/%f'

Of course you can chain archive_xlog to archive multiple times.

Backup and restore

As of 1.3, the best backup is found by storing the stop time of the backup as an offset from the Unix Epoch in the backup_timestamp file inside each backup directory. The files can be created from the backup_label files using this shell script:

BACKUP_DIR=/path/to/backup/dir
LABEL=pitr

for x in ${BACKUP_DIR}/${LABEL}/[0-9]*/backup_label; do
    psql -At -c "select extract(epoch from timestamp with time zone '`awk '/^STOP TIME:/ { print $3" "$4" "$5 }' $x`');" > `dirname $x`/backup_timestamp
done