Skip to content

Instantly share code, notes, and snippets.

@eoguvo
Created October 7, 2021 12:20
Show Gist options
  • Save eoguvo/e0f167ab794b0dcd42d4af0a7c413d04 to your computer and use it in GitHub Desktop.
Save eoguvo/e0f167ab794b0dcd42d4af0a7c413d04 to your computer and use it in GitHub Desktop.
# backup
docker exec -t your-db-container pg_dumpall -c -U postgres > dump_`date +%d-%m-%Y"_"%H_%M_%S`.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