Upgrade of invidious (PostgreSQL) database from 11 to 13 was easy!


I just wanted to share with you how I upgraded my #PostreSQL 11 database (mainly it stores my #Invidious instance) to 13 on my #Devuan box (everything needs to be done as root!).


  1. Stop both clusters, very easy: /etc/init.d/postgresql stop
  2. Backup old 13 directory (empty database in my case) just in case: cd /var/lib/postgresql/ && mv 13 13.previous
  3. Same goes for configuration files: cd /etc/postgresql/ && mv 13 13.previous
  4. Now just run the upgrade command: pg_upgradecluster 11 main
  5. It will take some time, but that's normal here. Your 13 cluster is already running after this step and 11 is offline.
  6. So it is time to backup all and remove 13.previous directories as the upgrade was a success. You can do this by renaming 11 to 11.backup or tar czvf 11.tar.gz /etc/postgresql/11/ /var/lib/postgresql/11/ it away.

Now only one cluster (13) is running here:
PostgreSQL version: 13.8 (Debian 13.8-0+deb11u1) through PHP extension PgSQL