restore database from bare files

From: jehan procaccia <jehan(dot)procaccia(at)free(dot)fr>
To: pgsql-admin(at)postgresql(dot)org
Subject: restore database from bare files
Date: 2005-06-29 18:20:06
Message-ID: 42C2E656.6010403@free.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

hello,

I crashed my server, and I didn't took the precaution to pg_dump one of
my database :-(
However I do have a tar file of the filesystem , it was on a RHEL 3 with
rh-postgresql-server-7.3.9-2 and I have a tar of /var/lib/pgslq
will just restoring the whole directory /var/lib/pgsql will suffices ?
or should I do some tricky operations ?
Here's what I have for example ..., how do I match a database name to
the number -> here 16975 is which database ?:
drwx------ / 0 2005-03-08 17:38:24 pgsql/data/base/16975/
-rw------- / 475136 2005-03-08 17:38:24
pgsql/data/base/16975/1255
-rw------- / 32768 2005-03-08 17:38:24
pgsql/data/base/16975/1247
and
-rw------- / 0 2005-03-08 17:38:22 pgsql/data/global/16675
and
drwx------ / 0 2005-05-31 18:14:51 pgsql/data/pg_xlog/
-rw------- / 16777216 2005-05-31 18:08:53
pgsql/data/pg_xlog/0000000000000011
-rw------- / 16777216 2005-06-28 15:33:10
pgsql/data/pg_xlog/0000000000000010
drwx------ / 0 2005-06-20 14:54:12 pgsql/data/pg_clog/
-rw------- / 262144 2005-06-01 18:15:07 pgsql/data/pg_clog/0000
-rw------- / 262144 2005-06-20 14:49:10 pgsql/data/pg_clog/0001
-rw------- / 32768 2005-06-28 15:10:19 pgsql/data/pg_clog/0002
and config files
-rw------- / 3080 2005-04-22 18:33:17 pgsql/data/pg_hba.conf
-rw------- / 1441 2005-03-08 17:38:22 pgsql/data/pg_ident.conf
-rw------- / 5331 2005-03-25 15:19:47
pgsql/data/postgresql.conf
-rw------- / 59 2005-06-28 15:27:14
pgsql/data/postmaster.opts

The crashed happened during an upgrade to RHEL 4 , so now on RHEL
postgresql version will be postgresql-server-7.4.7-2.RHEL4.1
<https://rhn.redhat.com/network/software/packages/details.pxt?cid=2866&id_combo=500000648%7c282969>!
any incompatibility or migration from 7.3.9-2 ?
thanks.

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Peter Eisentraut 2005-06-29 18:48:22 Re: restore database from bare files
Previous Message Jeff Frost 2005-06-29 15:08:28 Re: wal logs in pg_xlog