PostgreSQL method
- Navigate to your database bin folder, by default this is at C:\Testdriver\db\bin
- Open a command prompt to this location
- 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
- Navigate to your database bin folder, by default this is at C:\Testdriver\db\bin
- Open a command prompt to this location
- Create the Testdriver user, enter the following command : createuser.exe --username=postgres testdriver
- Create the Testdriver database, enter the following command : createdb.exe --username=testdriver testdriver
- 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