PostgreSQL - Dumping Data

Windows

cd "\Program Files\PostgreSQL\9.3\bin"
pg_dumpall -Upostgres > data.bu

Linux

su - postgres
pg_dumpall > data.bu
exit

PostgreSQL - Restoring Data

Since you are restoring the whole database you will need to delete the database completely. So please remember to do a back up before you do so. Also, you must stop tomcat.

Windows

cd "\Program Files\PostgreSQL\9.3\bin"
psql -Upostgres
drop database da;
\q
psql -Upostgres < data.bu

Linux

su - postgres
psql
drop database da;
\q
psql < data.bu
exit