Thread: Moving data to different hard drive /or/ incremental backup

Moving data to different hard drive /or/ incremental backup

From
"Brian Johnson"
Date:
I've been setting up a server system on a hard drive in a test box that I
think is close to ready to be moved to the main server (both are linux on
i386 machines in a small network of about 10 machines)

I'm having trouble finding instructions on how to handle my postgresql data

I've been using pg_dumpall to make backups and once I fed a backup file to
postgresql on the backup server

I can't get the test server to take the updated data that way (it seems my
problem is at least partly due to the fact that the structure of the tables
_and sequences_ have changed during development of some of the databases)

I'm a definite newbie at db admin - can someone point me to suitable
instructions and/or a concept of what I should do?

I've got a feeling that I should wipe the databases from the test server and
do a complete restore from a backup - is there a way to this this without
having to erase each database individually?



Re: Moving data to different hard drive /or/ incremental backup

From
Josh Berkus
Date:
Brian,

> I'm a definite newbie at db admin - can someone point me to suitable
> instructions and/or a concept of what I should do?

See the book reviews at Techdocs:
http://techdocs.postgresql.org/techdocs/bookreviews.php
... and buy yourself a nice all-in-one book.  Or two!

> I've got a feeling that I should wipe the databases from the test server and
> do a complete restore from a backup - is there a way to this this without
> having to erase each database individually?

Sure:

su postgres
pg_ctl stop
cd <postgres dir>/data
rm -rf *
initdb -D <postgres dir>/data
pg_ctl start

then load from pg_dumpall.

This is a 100% throurough erasure of the server, though ... don't do it if
you're not sure 100% of the data is backed up.

--
-Josh Berkus