Status: DRAFT
Postgres data can be exported using the pg_dump
utility.
Usage:
pg_dump -d {database} -U {user} --format=tar > dump.sql
Example (taking a backup of waltz database, db1):
pg_dump -U waltz --port 5632 --format=tar waltzdb1 > d:\dev\data\postgres-dump-1.46.sql
You will probably want to gzip
it down afterwards.
Usage:
psql -U {user} {database} < dump.sql
Example (restoring into a new blank database, db2):
pg_restore.exe -d waltzdb2 -U waltz --port 5632 < c:\temp\postgres-dump-1.46.sql