PostgreSQL - Dumping Data

Windows

cd "\Program Files\PostgreSQL\9.3\bin"
pg_dumpall -Upostgres > \usr\tomcat\webapps\da\WEB-INF\data\data.bu

Linux

su - postgres
pg_dumpall > /usr/tomcat/webapps/da/WEB-INF/data/data.bu

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 < \usr\tomcat\webapps\da\WEB-INF\data\data.bu

Linux

su - postgres
psql
drop database da;
\q
psql < /usr/tomcat/webapps/da/WEB-INF/data/data.bu