Save postgres database from broken ubuntu 10.04 server

Posted on

Question :

Recently a database server with an important db broke (some grub linux issue that I’d prefer not to solve).

I can still access the filesystem. Is there a chance to transfer the database by only moving some directories with content to an equal machine?

This is a 32 bit ubuntu 10.04 with postgres 8.4

Edit: On ubuntu 10,04 the postgresql data directory is /var/lib/postgresql/8.4/main and not /usr/local/pgsql/data

Answer :

I think backing up the “data directory” is what you want.

Moving the whole directory to a new server should be what you might look into. This will move everything within the cluster. From there, you can drop, move,… your single databases as you need to.

You might find this interesting:

Forensic Analysis of Corrupted Databases (PGCon 2010)

Leave a Reply

Your email address will not be published. Required fields are marked *