Postgres best practice backup and restore

Hi

I like to ask about various forms of doing backups and restore and exchange know-how. We use the pg_dump utility in the form like

/usr/local/pgsql/bin/pg_dump --host=localhost --port=5432 -U postgres --file=/Volumes/skyphos/backups/postgresql/backup13/postgresql.sql TrackIT

or data only

/usr/local/pgsql/bin/pg_dump --data-only -h localhost -p 5432 -U postgres -f/Volumes/skyphos/backups/postgresql/backup11/postgresql.sql TrackIT

Restore is done with

/usr/local/pgsql/bin/psql -U trackit -d TrackIT -f /Users/admin/Desktop/postgresql.sql

Are there other/better possibilities or conforms this already to best practice for postgres? What about using pgAdmin, advantages, disadvantages?

Regards,

Hi Robert,

PgAdmin uses pg_dump/pg_restore under the hood. It just provides an easy GUI for all the functionality you have in those command line tools.
The benefit of the command line tools is that you can use them in a shell script (*NIX/Windows) so you can automate them to your needs.

As you may know I already posted a backup script that dumps all your databases in your PostgreSQL cluster into separate sql files (schema and data). Feel free to change it to suite your needs.

Hope this helps.

Hello Robert!

http://forum.servoy.com/viewtopic.php?f=4&t=15208