Discussion:
How to upgrade a postgresql database?
(too old to reply)
Peter Nabbefeld
2018-08-17 13:57:18 UTC
Permalink
Hello,

I'm trying to upgrade a postgresql database, but it doesn't work. I've
also found this:
https://wiki.archlinux.org/index.php/PostgreSQL#Upgrading_PostgreSQL

This doesn't work for me, because there isn't any folder
/opt/pgsql-9.6/bin anymore - all the binaries are in /usr/bin. This
implies, there're no two versions of the binaries available, nor any
oldir or newdir (for -b / -B parameters).

It seems, I have to downgrade postgresql first, dump the database, and
restore it after upgrading again. Is there any easier method available
(i.e. some script which could do this automatically)?

Kind regards

Peter
Ismael Bouya
2018-08-17 14:05:58 UTC
Permalink
Hi Peter,
What version are you upgrading from? Starting at version 10, you don’t
need any particular operation to upgrade minor version (10.X -> 10.Y),
that’s why the old binaries are "stuck" at 9.6.
--
Ismael
Peter Nabbefeld
2018-08-17 14:11:45 UTC
Permalink
Post by Ismael Bouya
Hi Peter,
What version are you upgrading from? Starting at version 10, you don’t
need any particular operation to upgrade minor version (10.X -> 10.Y),
that’s why the old binaries are "stuck" at 9.6.
Current version is 9.6, updated version is 10.5
Ismael Bouya
2018-08-17 14:14:52 UTC
Permalink
Post by Peter Nabbefeld
Post by Ismael Bouya
Hi Peter,
What version are you upgrading from? Starting at version 10, you don’t
need any particular operation to upgrade minor version (10.X -> 10.Y),
that’s why the old binaries are "stuck" at 9.6.
Current version is 9.6, updated version is 10.5
Then you probably missed that part in the wiki page:
---
a postgresql-old-upgrade package is available that will always run one
major version behind the real PostgreSQL package. This can be installed
side-by-side with the new version of PostgreSQL.
---

Upgrading your system (after shutting down postgresql) and installing
postgresql-old-upgrade should give you /opt/pgsql-9.6/, your current
psql version, and /usr/bin/psql, your target version (10.6). From there,
following the wiki should permit you to upgrade the data to the target
version.
--
Ismael
Peter Nabbefeld
2018-08-17 14:14:54 UTC
Permalink
Post by Ismael Bouya
Hi Peter,
What version are you upgrading from? Starting at version 10, you don’t
need any particular operation to upgrade minor version (10.X -> 10.Y),
that’s why the old binaries are "stuck" at 9.6.
Thank You - now see I just missed the "postgresql-old-upgrade" - one
should read the line to its end.  ;-)

Regards
Peter
Celti Burroughs via arch-general
2018-08-17 14:13:11 UTC
Permalink
Post by Peter Nabbefeld
This doesn't work for me, because there isn't any folder
/opt/pgsql-9.6/bin anymore - all the binaries are in /usr/bin.
This implies, there're no two versions of the binaries
available, nor any oldir or newdir (for -b / -B parameters).
The old binaries in /opt are in the package postgresql-old-upgrade,
as the very wiki page you linked states.

~Celti
Peter Nabbefeld
2018-08-17 15:27:20 UTC
Permalink
Post by Celti Burroughs via arch-general
Post by Peter Nabbefeld
This doesn't work for me, because there isn't any folder
/opt/pgsql-9.6/bin anymore - all the binaries are in /usr/bin. This
implies, there're no two versions of the binaries available, nor any
oldir or newdir (for -b / -B parameters).
The old binaries in /opt are in the package postgresql-old-upgrade,
as the very wiki page you linked states.
~Celti
The confusing point here was the hint "Upgrade the packages:" - I just
upgraded my system before trying to upgrade the database, so I thought
it wouldn't relate to me ...

Peter

Loading...