How to dump and restore in Postgres Dump $ pg_dump -h localhost -p 5432 -U dbuser -F c -b -v -f "./dump" dbname Restore $ pg_restore -h localhost -p 5432 -U dbuser -d dbname -v ./dump