Skip to content

grabbing db backups and restoring

Shashike Jayatunge edited this page Jun 12, 2021 · 5 revisions

Grabbing a db dump

pg_dump --no-acl --no-privileges --clean --create --no-owner --host=ec2-3-83-199-128.compute-1.amazonaws.com -p 5432 --username=violet_staging_ubuntu --encoding=UTF-8 --file=restarone-solutions-staging.backup --format=c --dbname=violet_staging

copying the dump to the docker container

docker cp restarone-solutions-staging.backup solutions_db:/var/shared

open a shell in the database container

docker-compose exec solutions_db sh

Restoring to local

pg_restore --clean --no-acl --no-owner --format=c --jobs=8 -U postgres -d r_solutions_development var/shared/restarone-solutions-staging.backup
Clone this wiki locally