Greetings,
after a hdd failure, I have a PostgreSQL DB restored, but OS is not working. I try to copy it to another server with a newer version of PostgreSQL but all I managed to get is:
An old version of the database format was found.
You need to upgrade the data format before using PostgreSQL.
See /usr/share/doc/postgresql-8.1.22/README.rpm-dist for more information.
I don't know the old version number.
Please, advice me something.
Best Answer
If you were able to get all of the files in the data directory, then there should be a PG_VERSION file. Using this, you can build a database with that version. From my analysis, I haven't been able to find a way to restore the database data without a database with the correct version.
Here are some steps for recovery if you know the version:
http://archives.postgresql.org/pgsql-general/2009-09/msg01152.php
If you know that your last version is 8.3 or greater, this should work:
http://www.postgresql.org/docs/9.0/static/pgupgrade.html
Not a pleasant answer.