Skip to content

Instantly share code, notes, and snippets.

@joselo
Created August 29, 2017 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joselo/f529b7f8389053e12c26e5e2bdf72896 to your computer and use it in GitHub Desktop.
Save joselo/f529b7f8389053e12c26e5e2bdf72896 to your computer and use it in GitHub Desktop.
Docker Notes
# Backup database
docker exec -i APPNAME_db_1 pg_dump -U postgres -C APPNAME_production > /tmp/APPNAME_production.back
# Restore
docker exec -i APPNAME_db_1 psql -U postgres < APPNAME_production.back
# Rename database
docker exec -i APPNAME_db_1 psql -U postgres
ALTER DATABASE name RENAME TO new_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment