Monday, January 1, 2018

backup your Postgres Database Server

backup your Postgres Database Server


Very easy trick, but useful at the same time, whether you need to backup your PostgreSQL database server just follow these steps:

1. su postgres

2. psql -l

3. pg_dumpall > allmypgdata.sql

Now, in case you have any doubts, to check the databases had been backed up just use this:

 grep "^[]connect" allmypgdata.sql

You have to see all databases names

Thats all

visit link download