Hard upgrade (everything) - Mailing list pgsql-general

From Frank Broniewski
Subject Hard upgrade (everything)
Date
Msg-id 52F34172.1020804@metrico.lu
Whole thread Raw
Responses Re: Hard upgrade (everything)  (alexandros_e <alexandros.ef@gmail.com>)
List pgsql-general
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi list,

I've asked this question already on the PostGIS list, but I think it
might get great answers here too. I'm running two database cluster
with PostGIS 1.5 and PostgreSQL 9.1 on FreeBSD 9.2-RELEASE-p3 and
apparently my PostGIS and PostgreSQL are a little bit outdated.
Now the plan is to upgrade both PostGIS to 2.1 and PostgreSQL to 9.3,
 which are the latest versions in the ports.

Now, I am a little bit lost with all the precautions and measures one
has to undertake to do the hard upgrade. From what I read on the
PostgreSQL site, I can choose whether I want to use pg_upgrade
(without the need of a intermediate dump) or pg_dumpall to put the
data aside. I presume I can't use pg_upgrade since this wouldn't take
PostGIS into account, right?

That leaves me with pg_dumpall for the PostgreSQL upgrade. Now,
reading the PostGIS instructions to upgrade I come to the conclusion
that a binary dump is required to put the data aside while doing the
upgrade. Thing is pg_dump only dumps one spatial database, and I have
several in my clusters, so I'd need to dump all of them, right?

And here's where my confusion starts, since there are different tools
used for PostgreSQL and PostGIS for the individual upgrade. What would
be the correct procedure to dump a complete cluster in a PostGIS and
PostgreSQL compliant way? My ideas so far:

Step one: Use pg_dumpall to dump the roles and cluster metadata
Step two: Iterate and use pg_dump in binary mode to dump every
database in the cluster
Step three: rename/empty the target drive/folder
Step four: do the upgrade of PostgreSQL and PostGIS
Step five: restore the roles and metadata
Step six: use the command utils/postgis_restore.pl to restore each
individual database

Does that look sound?

On a side note, I tried upgrading each part individually, but the port
dependencies won't let me do that because upgrading PostgreSQL to 9.3
will also pull PostGIS 2.1 and upgrading PostGIS 2.1 will also pull
PostgreSQL 9.3, so I only get the two of them ...


Any tips on the procedure are greatly welcome :-)

Frank

- --
Frank BRONIEWSKI

METRICO s.à r.l.
géomètres
technologies d'information géographique
rue des Romains 36
L-5433 NIEDERDONVEN

tél.: +352 26 74 94 - 28
fax.: +352 26 74 94 99
http://www.metrico.lu
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJS80FVAAoJEHopqW0d1cQVjzMIAJQ6povfOSYg0NIw5DXF0KlZ
0MQQjwoOwRIPrCkllwDEpmioI2OtkBH03LYuQQYi8SArovtBRlTwyvZsUgFuuxy6
qAQhHcGxLyJPvxBIXVRhqnmn89a1otGxXTI+ZedNbJsj74vW0h29KRBAyklphe/C
iAGw8+2zr0yiBLJdHWZvnMdS0PkL4jc7UY1XfmCg3AvNQU1EgiUYdWOEn26fqj0g
bXrpHERgv8c+Hk8r8/G4WRD6rC0aMirB0lynxn+FHhSc9mzXUbDbER99M06vXrtF
uIIeOTfr/Pu5eyjHDc3stg2LAtoNTvnvvJ0S+5Shi6ndLRy3P7AHZ6y915AMkRA=
=4KIY
-----END PGP SIGNATURE-----


pgsql-general by date:

Previous
From: 坂本 翼
Date:
Subject: client encoding that psql command sets
Next
From: mephysto
Date:
Subject: Re: Temporary table already exists