Skip to content

Instantly share code, notes, and snippets.

@leeeandroo
Created February 6, 2019 08:57
Show Gist options
  • Save leeeandroo/ca10d8dfee0e8734bb10836ebd2d35c4 to your computer and use it in GitHub Desktop.
Save leeeandroo/ca10d8dfee0e8734bb10836ebd2d35c4 to your computer and use it in GitHub Desktop.
Backup PSQL from docker container
Backup:
docker exec -t -u postgres your-db-container pg_dumpall -c > your_dump.sql
Restore:
cat your_dump.sql | docker exec -i your-db-container psql -U postgres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment