[postgis-users] Upgrading PostGIS

Tomas Straupis tomasstraupis at gmail.com
Thu Dec 17 23:44:46 PST 2020

2020-12-17, kt, 22:46 Clifford Snow rašė:
> I want to upgrade Postgresql from 11 to 13 and PostGIS from 2.5 to 3.1 on a Fedora Workstation. Is it possible?

  If I understand you correctly, you're using both postgresql and
postgis packages from fedora repos?
  If so, these are my notes, I use Fedora:
  I've found it impossible to upgrade using only core packages,
because if both postgre and postgis versions change, upgraded system
is unusable (db upgrade fails), because you have to upgrade postgresql
and during upgrade it needs access to both new and OLD versions of
postgis libraries, and old libraries have to be compiled using all old
libraries used in old postgresql. Therefore several years ago I
switched to using core postgresql but postgis compiled from source.
  Now my notes on upgrading are:
  1. BEFORE upgrading postgresql upgrade postgis to whatever newest
version of postgis you want to use.
  2. Make a copy of postgis/SFCGAL etc. libraries (.so files), for
example everything from /usr/lib64/pgsql
  3. vacuumdb -a -f -v
  4. pg_dump (just to be on the safe side, but not mandatory)
  5. Upgrade Fedora (and postgresql with it).
  6. Copy the files you copied in step 2 to
/usr/lib64/pgsql/postgres-XX/lib where XX - old version of postgresql
you were upgrading from.
  7. Compile postgis for the new upgraded postgresql
  8. Upgrade the database

More information about the postgis-users mailing list