My OS is windows 7 x64. I was use postgres 8.4, and all databases are in postgres/8.4/data
. Yesterday, I reinstalled my os system, but I found I can't install postgres 8.4 anymore (there is always an error when installing), so I installed postgres 9.1.
But I don't know how to reuse the data of postgres 8.x. I tried to copy the data from postgres/8.4/data
to postgres/9.1/data
, but the postgres service won't start.
Is there any way to reuse that. Since I have a lot of data in postgres/8.4/data
, I can't loose them.
-
you might find this by @depesz helpful tooJack Douglas– Jack Douglas2012年03月09日 09:02:09 +00:00Commented Mar 9, 2012 at 9:02
1 Answer 1
What you need is a dump / restore. However, for this to work, you need the old PostgreSQL 8.4 server running. The new version 9.1 is not binary compatible and cannot use the files in postgres/8.4/data
directly.
If you have no backup and cannot run PostgreSQL 8.4 on your machine any more, you are out of luck. Why is it that you cannot install PostgreSQL 8.4 any more? You'll have to, if you want your data.
On a side note:
It is recommended that you use the pg_dump
and pg_dumpall
programs from the newer version of PostgreSQL, to take advantage of any enhancements that may have been made in these programs.
-
1The OP might be able to install 8.4 on a different machine, and move the data files to it. Then pg_dumpall from 8.4, move the dump files to 9.1, and load them.Mike Sherrill 'Cat Recall'– Mike Sherrill 'Cat Recall'2012年04月10日 08:49:54 +00:00Commented Apr 10, 2012 at 8:49