User Tools

Site Tools


doc:appunti:linux:sa:postgresql_upgrade_11_to_13

This is an old revision of the document!


PostgreSQL/PostGIS Upgrade from 11 to 13

Notes about upgrading a Debian 10 Buster to Debian 11 Bullseye, this causes the following packages upgrade:

  • Debian 10 Buster
    • postgresql-11
    • postgresql-11-postgis-2.5
  • Debian 11 Bullseye
    • postgresql-13
    • postgresql-13-postgis-3

The PostgreSQL database will upgrade from version 11.16 to 13.7, the PostGIS library will upgrade from version 2.5.1 to 3.1.1.

Once the system is fully upgraded, you will find that your databases still run on the older 11/main cluster. Switch to the postgres user and run the pg_lsclusters command:

pg_lsclusters
Ver Cluster Port Status Owner    Data directory              Log file
11  main    5432 online postgres /var/lib/postgresql/11/main /var/log/postgresql/postgresql-11-main.log
13  main    5433 online postgres /var/lib/postgresql/13/main /var/log/postgresql/postgresql-13-main.log

As you can see the default 5432/TCP port is still used by the old version. Connect to both the clusters and check where are your databases: they are still on the old cluster and they are using the old PostGIS extension:

psql --cluster 11/main
postgres=# \l
        Name        |       Owner        | Encoding |   Collate   |    Ctype    |   Access privileges   
--------------------+--------------------+----------+-------------+-------------+-----------------------
 postgres           | postgres           | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 strade             | strade             | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
...

postgres=# \connect strade
strade=# \dx
                                     List of installed extensions
  Name   | Version |   Schema   |                             Description                             
---------+---------+------------+---------------------------------------------------------------------
 plpgsql | 1.0     | pg_catalog | PL/pgSQL procedural language
 postgis | 2.5.1   | public     | PostGIS geometry, geography, and raster spatial types and functions
doc/appunti/linux/sa/postgresql_upgrade_11_to_13.1657184726.txt.gz · Last modified: 2022/07/07 11:05 by niccolo