PostgreSQL method

  1. Navigate to your database bin folder, by default this is at C:\Testdriver\db\bin
  2. Open a command prompt to this location
  3. Enter the following command, replacing the path after --file with your desired output file name : pg_dump.exe --username=testdriver --dbname=testdriver --file="C:\temp\td_db"

Restore a database from a dump file

  1. Navigate to your database bin folder, by default this is at C:\Testdriver\db\bin
  2. Open a command prompt to this location
  3. Create the Testdriver user, enter the following command : createuser.exe  --username=postgres testdriver
  4. Create the Testdriver database, enter the following command : createdb.exe --username=testdriver testdriver
  5. Finally to restore the data from the database dump, enter the following command, replacing the path after --file with your desired output file name : psql.exe --username=testdriver --file="C:\temp\td_db"

Other methods

There are many other backup options for PostgreSQL available, more details on the above method can be found here: 

https://www.postgresql.org/docs/9.4/static/backup-dump.html

High-end solutions are also possible, the documentation explaining the different methods and implementations can be found on the PostgreSQL website:

http://www.postgresql.org/docs/9.1/static/high-availability.html