Re: 8.4 Data Not Compatible with 9.0.1 Upgrade?

From: Leif Biberg Kristensen <leif(at)solumslekt(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: 8.4 Data Not Compatible with 9.0.1 Upgrade?
Date: 2010-11-02 21:50:16
Message-ID: 201011022250.16427.leif@solumslekt.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tuesday 2. November 2010 22.37.33 Carlos Mennens wrote:
> On Tue, Nov 2, 2010 at 10:53 AM, Steve Clark <sclark(at)netwolves(dot)com> wrote:
> > mv /var/lib/postgres/data /var/lib/postgres/data.old
>
> Before I move or rename '/var/lib/postgres/data', what version of
> PostgreSQL should I be at? 8.4 or 9.0?

You should be at 9.0. The important thing is that you must start the new
installation initdb with an empty data directory, or you'll inevitably get
the complaints about incompatibility with the old files. It's quite logical,
really, if you think about it.

> > You will then have to do an initdb to create the basic 9.x databases.
> > You can then use psql or pg_restore depending on how you dumped
> > your data to restore your databases.
>
> I simply ran the following command:
>
> /usr/bin/pg_dump finance > finance.sql

That's only the first part of the upgrade process. Then you must prepare an
empty directory to acommodate your data, do an initdb, and then populate the
new directory from your dump file.

I think that the Gentoo method works great: In the /var/lib/postgres
directory, we just create a new subirectory named /8.3, /8.4, /9.0, and so on,
and then a new /data directory under each one. That way, you can safely remove
the old data when you've confirmed that the new version actually works.

regards,
Leif B. Kristensen

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2010-11-02 21:54:50 Re: 8.4 Data Not Compatible with 9.0.1 Upgrade?
Previous Message Carlos Mennens 2010-11-02 21:37:33 Re: 8.4 Data Not Compatible with 9.0.1 Upgrade?