Thread: Upgraded to Red Hat 7.1, now my DB is toast?
I had PGSQL up and running fine on RH6.2 (whatever version comes with RH6.2). For some fool reason, I thought I'd upgrade to 7.1. While reconfiguring my system after having almost all of my settings mysteriously vanish, I finally get to starting up postmaster and get this error: /usr/bin/postmaster does not find the database system. Expected to find it in the PGDATA directory "/var/lib/pgsql/data", but unable to open file with pathname "/var/lib/pgsql/data/base/template1/pg_class". No data directory -- can't proceed. Ack. The /var/lib/pgsql/data/base does exist but there is no template1 dir... Does this mean that DBs made with 6.whatever are incompatible with 7.whatever? And if so, is there a way to recover/upgrade/save the db I already have? Thanks in advance for any advice. Later, J. J. Franzen
Hi JJ When I start my postmaster without specifying the -D option I get the same error. Here's how I start mine (as user "postgres"): postmaster -D /usr/local/pgsql/data -i -d 2 -o "-d 2" >> /path/to/log/file.log 2>&1 & That's all on one line, of course. The -D option specifies the location of the data directory your postmaster is complaining about. Hope that helps, Eric. J. J. Franzen wrote: > I had PGSQL up and running fine on RH6.2 (whatever version comes with > RH6.2). For some fool reason, I thought I'd upgrade to 7.1. While > reconfiguring my system after having almost all of my settings > mysteriously vanish, I finally get to starting up postmaster and get > this error: > > /usr/bin/postmaster does not find the database system. Expected to find > it in the PGDATA directory "/var/lib/pgsql/data", but unable to open > file with pathname "/var/lib/pgsql/data/base/template1/pg_class". > > No data directory -- can't proceed. > > Ack. The /var/lib/pgsql/data/base does exist but there is no template1 > dir... Does this mean that DBs made with 6.whatever are incompatible > with 7.whatever? And if so, is there a way to recover/upgrade/save the > db I already have? Thanks in advance for any advice. Later, > > J. J. Franzen > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
Major version changes of Postgres require a dump (to text) of the database and a restore from that file. You will need to reinstall the old version of Postgres and dump the database using pg_dumpall, then upgrade to 7.1 and restore from the dump. Postgres requires dumps/restores any time there is a significant version change: 6.5.x ->7.0.x requires a dump/restore 7.0.0 -> 7.0.2 does not require a dump 7.0.x->7.1.x requires a dump/restore --rob ----- Original Message ----- From: "Eric Walstad" <eric@walstads.net> To: "J. J. Franzen" <jfranzen@cinenet.net> Cc: <pgsql-novice@postgresql.org> Sent: Wednesday, June 06, 2001 11:36 AM Subject: Re: Upgraded to Red Hat 7.1, now my DB is toast? > Hi JJ > > When I start my postmaster without specifying the -D option I get the > same error. Here's how I start mine (as user "postgres"): > > postmaster -D /usr/local/pgsql/data -i -d 2 -o "-d 2" >> > /path/to/log/file.log 2>&1 & > > That's all on one line, of course. The -D option specifies the location > of the data directory your postmaster is complaining about. > > Hope that helps, > > Eric. > > J. J. Franzen wrote: > > > I had PGSQL up and running fine on RH6.2 (whatever version comes with > > RH6.2). For some fool reason, I thought I'd upgrade to 7.1. While > > reconfiguring my system after having almost all of my settings > > mysteriously vanish, I finally get to starting up postmaster and get > > this error: > > > > /usr/bin/postmaster does not find the database system. Expected to find > > it in the PGDATA directory "/var/lib/pgsql/data", but unable to open > > file with pathname "/var/lib/pgsql/data/base/template1/pg_class". > > > > No data directory -- can't proceed. > > > > Ack. The /var/lib/pgsql/data/base does exist but there is no template1 > > dir... Does this mean that DBs made with 6.whatever are incompatible > > with 7.whatever? And if so, is there a way to recover/upgrade/save the > > db I already have? Thanks in advance for any advice. Later, > > > > J. J. Franzen > > > > > > ---------------------------(end of broadcast)--------------------------- > > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org > > >
On 02 Jun 2001 00:51:56 -0700, J. J. Franzen wrote: > dir... Does this mean that DBs made with 6.whatever are incompatible > with 7.whatever? And if so, is there a way to recover/upgrade/save the > db I already have? Thanks in advance for any advice. Later, Exactly. Upgrading to 7.1 requires an initdb. I'd recommend: pg_dump -D dbname >dbname.sql (or use pg_dumpall) and after installing 7.1 (and initdb) psql -f dbname.sql -- Nabil Sayegh