DB Dump/Restore

Summary 

This page will explain how to take a DB dump and restore it. 

Take a DB Dump

DB dump can be taken on each level of DB (depends on goals), for instance: table level, Scheme level and DB level

Using PGAdmin tool - choose appropriate table - scheme→ right click to open context menu→ choose "Backup..."

 

In "Backup.." menu specify name of file to be created and format (Cusom format will create encoded file, plain format will create human readable .sql file)

After clicking "Backup" in a few minutes it will create .sql file including all data + constraints+ indexes+etc.

Restore a DB Dump

To restore Custom format DB bump you can use UI in a similar way as on screenshoots above (Using psql cmd interface is not recommended because of frequent versions mismatch)

To restore Plain format .sql file you should use psql cmd interface. 

simply this command (.sql file name is Dump.sql for convenience):

psql -f Dump.sql -a --echo-all -h [HostName] -U [Username]

DB dump example: