Wednesday, February 15, 2017

Postgres backup and restore using pg_dump

Backup & Restore commands for postgres database


-Backup using dumpall command (take backup of all db's):

pg_dumpall -c -U postgres -h localhost -p 5432  -f sample.dump

-Restore using psql command

psql -U postgres -h localhost -p 5432 -f sample2.dump postgres

No comments:

Post a Comment

Terraform Cheat Sheet [WIP]

Installing Terraform