Skip to content

Instantly share code, notes, and snippets.

@bobishh
Last active January 24, 2017 14:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bobishh/cee29c25f8f3546d8c791194bbc4c514 to your computer and use it in GitHub Desktop.
Save bobishh/cee29c25f8f3546d8c791194bbc4c514 to your computer and use it in GitHub Desktop.
#create dump:
pg_dump -h <HOSTNAME> -U <USERNAME> -b -Fc <DBNAME> | bzip2 -c > <WHERE_TO_DUMP>.bz2
#restore dump:
bzip2 -d -c <FILE> | pg_restore -h <HOSTNAME> -U <USERNAME> -d <DBNAME> -Fc -O -c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment