Easy backup and restore of postgresql databases

For getting a copy of a live system’s postgres databases onto a development platform, it’s easiest to just dump the whole thing and restore it on the dev machine.

I don’t want just one or two databases, or even just all the data, I want everything to match exactly.

$ pg_dumpall > ~/data.dump

To load it onto the new machine (restore), I just copy it over to the remote machine or walk it over on a thumbdrive.

$ sudo su postgres -
$ psql -f data.dump postgres

Posted by admica   @   10 February 2009

Related Posts

Like this post? Share it!

Digg Twitter StumbleUpon Delicious Technorati Facebook RSS

0 Comments

No comments yet. Be the first to leave a comment !
Leave a Comment

Name

Email

Website

Previous Post
« One deal at a time sites, old crap or good deals?
Next Post
Removing blank lines from text files automatically or interactively »
Powered by Wordpress   |   Lunated designed by ZenVerse