Postgres Utility tools
495
docker run --rm \
--link postgres_server:postgresserver \
-v /path/to/backup/path:/data \
-e POSTGRES_DB_USER=root \
-e POSTGRES_DB_PASS=secret \
-e POSTGRES_DB_NAME=mydatabase \
-e DUMP_SUFFIX=production \
-e DUMP_EXPLODED=true \
nouvellemarque/postgres-tools dump
postgres_server - the postgres docker container/path/to/backup/path - the path on your host where the backup would be storedDUMP_SUFFIX - suffix for each fileDUMP_EXPLODED - dump all tables into separate filesdocker run --rm \
--link postgres_server:postgresserver \
-v /path/to/backup/path:/data \
-e DUMP_FILE=dumpfile.tar.gz \
-e POSTGRES_DB_USER=root \
-e POSTGRES_DB_PASS=secret \
nouvellemarque/postgres-tools restore
postgres_server - the postgres docker containerSOURCE - the filename of the dump to restore/path/to/backup/path - the path on your host where the backup is storeddocker run --rm \
--link postgres_server:postgresserver \
-v /path/to/backup/path:/data \
-e DUMP_FILE=dumpfile.tar.gz \
-e DUMP_DB_TARGET=mynewdatabase \
-e POSTGRES_DB_USER=root \
-e POSTGRES_DB_PASS=secret \
nouvellemarque/postgres-tools restore
DUMP_DB_TARGET - the name of the database to restoreContent type
Image
Digest
Size
126.3 MB
Last updated
over 6 years ago
docker pull nouvellemarque/postgres-tools