roadmax
Goto Top

Upgrade von Postgresql 10 auf 12

Hallo Zusammen,

ich habe einen Ubuntu Server von 18.04 auf 20.04 aktualisiert. In diesem Zug muss ich Postgresql von 10 auf 12 aktualisieren. Wenn ich das Cluster Upgrade ausführen möchte, kommt der Fehler, dass er postgis-2.4 sucht aber auf dem Server nur 2.5 zur Verfügung steht.

pg_upgradecluster 10 main
Stopping old cluster...
Restarting old cluster with restricted connections...
Notice: extra pg_ctl/postgres options given, bypassing systemctl for start operation
Creating new PostgreSQL cluster 12/main ...
/usr/lib/postgresql/12/bin/initdb -D /var/lib/postgresql/12/main --auth-local peer --auth-host md5 --encoding UTF8 --lc-collate en_US.UTF-8 --lc-ctype en_US.UTF-8
The files belonging to this database system will be owned by user "postgres".  
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".  
The default text search configuration will be set to "english".  

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/12/main ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Europe/Berlin
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

Success. You can now start the database server using:

    pg_ctlcluster 12 main start

Ver Cluster Port Status Owner    Data directory              Log file
12  main    5433 down   postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log

Starting new cluster...
Notice: extra pg_ctl/postgres options given, bypassing systemctl for start operation
Roles, databases, schemas, ACLs...
pg_dump: error: query failed: ERROR:  could not access file "$libdir/postgis-2.4": No such file or directory  

Hat jemand eine Idee?

Gruß,
Roadmax

Content-Key: 4111365907

Url: https://administrator.de/contentid/4111365907

Printed on: April 25, 2024 at 10:04 o'clock

Mitglied: 141986
141986 Sep 30, 2022 updated at 15:13:00 (UTC)
Goto Top
Hallo,

Idee/Ansatz

Vorschlag: Backup anlegen.

Gruß
Mitglied: 137960
Solution 137960 Sep 30, 2022 at 16:33:34 (UTC)
Goto Top
Ich kann nur raten:

PostgreSQL 12 unterstützt PostGIS 2.5 und höher.
Wahrscheinlich hättest Du PostGIS VOR dem Update von PostgreSQL aktualisieren sollen. Hier die Versionsmatrix:
https://trac.osgeo.org/postgis/wiki/UsersWikiPostgreSQLPostGIS

Und hier die Info zum Upgrade der Erweiterung:

https://postgis.net/docs/PostGIS_Extensions_Upgrade.html

Auch in dieser Doku wird sowas empfohlen:

https://postgis.net/workshops/postgis-intro/upgrades.html


Also: Backup zurückspielen, dann zuerst PostGIS aktualisieren, danach pg_upgrade