Re: Upgrading from Postgres 9.3 to 9.5 - Mailing list pgsql-novice

From Kevin Struckhoff
Subject Re: Upgrading from Postgres 9.3 to 9.5
Date
Msg-id DM2PR0101MB07815BA307C55B614354FFCBD2940@DM2PR0101MB0781.prod.exchangelabs.com
Whole thread Raw
In response to Re: Upgrading from Postgres 9.3 to 9.5  (Keith <keith@keithf4.com>)
List pgsql-novice

Why can’t I just point to the new 9.5 binaries and use the old 9.3 PGDATA, PGPORT, etc values to begin with? Seems like a more straightforward upgrade path and that’s how I used to upgrade my Informix db instances.

 

In order to use pg_upgrade, I’d have to increase the / filesystem where /var resides, and that’s not the right answer.

 

Thanks

 

 

From: Keith [mailto:keith@keithf4.com]
Sent: Monday, April 11, 2016 11:06 AM
To: Kevin Struckhoff <kevins@thermal.com>
Cc: pgsql-novice@postgresql.org
Subject: Re: [NOVICE] Upgrading from Postgres 9.3 to 9.5

 

 

On Mon, Apr 11, 2016 at 1:28 PM, Kevin Struckhoff <kevins@thermal.com> wrote:

Hi,

 

I’m attempting my first upgrade of Postgres from 9.3 to 9.5. I’ve run into two roadblocks but not sure how to get around them. I have my 9.3 PGDATA set to /data/postgres, which is a separate filesystem on my RHEL 6 server. After installing 9.5 and running initdb, I attempted to run pg_upgrade using this command line:

 

/usr/pgsql-9.5/bin/pg_upgrade -b /usr/pgsql-9.3/bin -B /usr/pgsql-9.5/bin -d /data/postgres -D /var/lib/pgsql/9.5/data --link -p 5432 -P 5433 -c

 

This command failed the link parameter test, because the 9.5 PGDATA value is not on the same filesystem as 9.3. Roadblock #1.

 

I then tried to re-initialize 9.5 using this command: initdb -D /data/postgres95. It errored saying ‘Data directory is not empty!’. Roadblock #2.

 

How do I proceed with this upgrade? I’d rather not move to a new server.

 

Thanks

Kevin Struckhoff

 

 

The --link option will not work across different file systems. If you need to move to a different filesystem, you'll have to do it without that option and it will copy the data files from the old filesystem to the new one. That does give you the advantage of being able to "undo" the upgrade if things go wrong since your old 9.3 data files will remain untouched, but it will take longer.


The first attempt likely created files in the new 9.5 data directory, so you'll have to clean those up. initdb must be run on an empty directory (as the error hints at).

 

Keith

pgsql-novice by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Upgrading from Postgres 9.3 to 9.5
Next
From: Kip Warner
Date:
Subject: Re: Query to return normalized floats