Skip to content

Instantly share code, notes, and snippets.

@harshalbhakta
Created February 14, 2018 06:01
Show Gist options
  • Select an option

  • Save harshalbhakta/6ecee17b50cbc0f079ec29d01fad71ef to your computer and use it in GitHub Desktop.

Select an option

Save harshalbhakta/6ecee17b50cbc0f079ec29d01fad71ef to your computer and use it in GitHub Desktop.
Postgresql Manual Backup & Restore
On Server
$ pg_dump -U dbadmin -d dbprd > ~/temp/db-backups/db-backup-14-feb-2018.pgsql
On Dev Machine
$ scp deployer@example.com:/home/deployer/temp/db-backups/db-backup-14-feb-2018.pgsql ./db-backup-14-feb-2018.pgsql
$ psql -U dbadmin -d development_database < db-backup-14-feb-2018.pgsql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment