Skip to content

Instantly share code, notes, and snippets.

@luizpicolo
Created July 3, 2017 12:47
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 luizpicolo/a28cb775eacd5a43d02de3ae4a7284d5 to your computer and use it in GitHub Desktop.
Save luizpicolo/a28cb775eacd5a43d02de3ae4a7284d5 to your computer and use it in GitHub Desktop.
This is what I would do to backup my old database and restore
To back up your database
pg_dump --format=c olddb_name > db_dump_file.dump
To restore that backup
pg_restore -v -d newdb_name db_dump_file.dump
Read more on pg_dump and pg_restore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment