The restore running mode 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.

MODE: pgrestore

Environment Variables


Name Default Description
MODE None Set to pgrestore to run as pg_restore job
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.


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.

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.