Thread: Upgrading database format on PostgreSQL 8.1 on FC6
Hi,
I have an older server I am trying to restore a dump onto.
The server is FC6 on an x86_64 machine:
2.6.22.14-72.fc6 #1 SMP Wed Nov 21 14:10:25 EST 2007 x86_64 x86_64 x86_64 GNU/Linux
PostgreSQL is:
[root@devdb3 8.1]# rpm -qa | grep postgres
mono-data-postgresql-1.1.17.1-5.fc6
postgresql-8.1.10-1.fc6
postgresql-libs-8.1.10-1.fc6
postgresql-server-8.1.10-1.fc6
compat-postgresql-libs-debuginfo-4-1PGDG%{dist}
postgresql-libs-8.1.10-1.fc6
postgresql-jdbc-8.1.407-1jpp.4
postgresql-docs-8.2.7-1PGDG
When I try to start postgresql I get a database format error:
[root@devdb3 8.1]# service postgresql start
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.10/README.rpm-dist for more information.
I read the file mentioned above but didn't really get any more information than what the error gave me. I can't tell whether there is a tool/utility that allows me to upgrade the data format without running postgresql itself.
Should I uninstall and reinstall Postgres 8.1 or can I fix the above without doing that ?
I have an older server I am trying to restore a dump onto.
The server is FC6 on an x86_64 machine:
2.6.22.14-72.fc6 #1 SMP Wed Nov 21 14:10:25 EST 2007 x86_64 x86_64 x86_64 GNU/Linux
PostgreSQL is:
[root@devdb3 8.1]# rpm -qa | grep postgres
mono-data-postgresql-1.1.17.1-5.fc6
postgresql-8.1.10-1.fc6
postgresql-libs-8.1.10-1.fc6
postgresql-server-8.1.10-1.fc6
compat-postgresql-libs-debuginfo-4-1PGDG%{dist}
postgresql-libs-8.1.10-1.fc6
postgresql-jdbc-8.1.407-1jpp.4
postgresql-docs-8.2.7-1PGDG
When I try to start postgresql I get a database format error:
[root@devdb3 8.1]# service postgresql start
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.10/README.rpm-dist for more information.
I read the file mentioned above but didn't really get any more information than what the error gave me. I can't tell whether there is a tool/utility that allows me to upgrade the data format without running postgresql itself.
Should I uninstall and reinstall Postgres 8.1 or can I fix the above without doing that ?
-- Regards, Arjun Datta Great Gulf Homes / Ashton Woods Homes 416 441 1262 x2822
Arjun Datta wrote: > Hi, > > I have an older server I am trying to restore a dump onto. > A _filesystem_ dump of the PG data files of or a _PostgreSQL_ dump using pg_dump/pg_dumpall? This sounds like a problem stemming from a filesystem dump. If it is a file-system dump, you will need to restore the files into the server's data directories. The PG server version must match the major version the file-system came from. Additionally, you will probably need to attempt the restore onto a machine of the same architecture. Even then, you may have problems - especially if the dump was made while PG was running. If you have a running version of the database somewhere you will be better off using the pg_dump/pg_dumpall tools to do the dump (and if migrating to a newer version of PG, use the pg_dump/pg_dumpall from the newer PG version) then restore from that dump. If you don't have the data in a currently functioning PG server and you do succeed in recovering the data, do a PostgreSQL dump ASAP. Cheers, Steve
Steve Crawford wrote:
Hi Steve,
Thanks for the response. I should have been clearer initially.
I have a PG dump (using pg_dumpall) from a PostgreSQL 7.3.4 server on Redhat 7.2 that I am trying to restore.
But on the newer machine (I cannot verify if postgres has ever been run on it or if it did when last), even before I try to restore, I notice that on startup I get the following error.
[root@devdb3 8.1]# service postgresql start
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.10/README.rpm-dist for more information.
So, even without getting to the restore stage using psql as outlined here:
http://www.postgresql.org/docs/7.4/interactive/backup.html#BACKUP-DUMP-ALL
I would like to fix the above error first.
Arjun
Arjun Datta wrote:Hi,A _filesystem_ dump of the PG data files of or a _PostgreSQL_ dump using pg_dump/pg_dumpall? This sounds like a problem stemming from a filesystem dump.
I have an older server I am trying to restore a dump onto.
If it is a file-system dump, you will need to restore the files into the server's data directories. The PG server version must match the major version the file-system came from. Additionally, you will probably need to attempt the restore onto a machine of the same architecture. Even then, you may have problems - especially if the dump was made while PG was running.
If you have a running version of the database somewhere you will be better off using the pg_dump/pg_dumpall tools to do the dump (and if migrating to a newer version of PG, use the pg_dump/pg_dumpall from the newer PG version) then restore from that dump.
If you don't have the data in a currently functioning PG server and you do succeed in recovering the data, do a PostgreSQL dump ASAP.
Cheers,
Steve
Hi Steve,
Thanks for the response. I should have been clearer initially.
I have a PG dump (using pg_dumpall) from a PostgreSQL 7.3.4 server on Redhat 7.2 that I am trying to restore.
But on the newer machine (I cannot verify if postgres has ever been run on it or if it did when last), even before I try to restore, I notice that on startup I get the following error.
[root@devdb3 8.1]# service postgresql start
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.10/README.rpm-dist for more information.
So, even without getting to the restore stage using psql as outlined here:
http://www.postgresql.org/docs/7.4/interactive/backup.html#BACKUP-DUMP-ALL
I would like to fix the above error first.
Arjun
Arjun Datta <arjun@greatgulfhomes.com> writes: > I have a PG dump (using pg_dumpall) from a PostgreSQL 7.3.4 server on > Redhat 7.2 that I am trying to restore. > But on the newer machine (I cannot verify if postgres has ever been run > on it or if it did when last), even before I try to restore, I notice > that on startup I get the following error. > [root@devdb3 8.1]# service postgresql start > An old version of the database format was found. > You need to upgrade the data format before using PostgreSQL. If you know that there is no useful data on the machine, just rm -rf /var/lib/pgsql/data (or wherever PGDATA is ... it's a good idea to look into the start script to be sure). regards, tom lane
Arjun Datta wrote: > But on the newer machine (I cannot verify if postgres has ever been run > on it or if it did when last), even before I try to restore, I notice > that on startup I get the following error. > > [root@devdb3 8.1]# service postgresql start > > 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.10/README.rpm-dist for more information. If there is nothing in current pg databases you want to keep; then have a look at initdb command; which will initialise your system for current release installed on system. Any existing data is wiped out.