Skip to content

Instantly share code, notes, and snippets.

@bianchimro
Created January 29, 2019 19:19
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 bianchimro/e4b3c39c2c88d9ed24ce7dd8a61e903d to your computer and use it in GitHub Desktop.
Save bianchimro/e4b3c39c2c88d9ed24ce7dd8a61e903d to your computer and use it in GitHub Desktop.
postgres db dump and restore
/usr/bin/pg_dump -Ft --no-acl --no-owner -h <HOST> -p 5432 -U <USER> <DB_DA_COPIARE> -f /tmp/dump.tar && \
/usr/bin/pg_restore -n public -h <HOST> -p 5432 -U <USER> -d <DB_NUOVO> /tmp/tmp.tar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment