crunchy-pgrestore

The restore image provides a means of performing a restore of a dump from pg_dump or pg_dumpall via psql or pg_restore to a PostgreSQL container database.

Packages

The crunchy-pgrestore Docker image contains the following packages (versions vary depending on PostgreSQL version):

  • PostgreSQL (12.5, 11.10, 10.15, 9.6.20 and 9.5.24)
  • CentOS7 - publicly available
  • UBI7 - customers only

Environment Variables

Required

Name Default Description
PGRESTORE_DB None Name of the database to connect to.
PGRESTORE_HOST None Hostname of the database to connect to.
PGRESTORE_PASS None Password for the PostgreSQL role being used.
PGRESTORE_USER None Username for the PostgreSQL role being used.

Optional

Name Default Description
PGDUMP_BACKUP_HOST None Hostname of the PostgreSQL server that was backed up by pgdump container. Used when restoring a backup to a new host.
PGRESTORE_BACKUP_TIMESTAMP Empty Timestamp of the backup to restore from.
PGRESTORE_CUSTOM_OPTS Empty Advanced options to pass into pg_restore.
PGRESTORE_PORT 5432 Port of the PostgreSQL database to connect to.
CRUNCHY_DEBUG FALSE Set this to true to enable debugging in logs. Note: this mode can reveal secrets in logs.
For a list of advanced options for configuring the `PGRESTORE_CUSTOM_OPTS` variable, see the [official documentation](https://www.postgresql.org/docs/current/static/app-pgrestore.html).

Volumes

Name Description
/pgdata Volume used to store the data directory contents for the PostgreSQL database.

Dump-file Input Location

As the input files for crunchy-pgrestore, files generated by crunchy-pgdump are retrieved in a mounted backup volume location, using the database host name plus -backups as a sub-directory, then followed by a unique backup directory based upon a date/timestamp. It is left to the user to restore database dump archives in this current version of the container.