With Zabbix release 7.0.6 (Release Notes for Zabbix 7.0.6) both TimescaleDB extension 2.7 (ZBXNEXT-9532) and PostgreSQL 17 (ZBXNEXT-9238) became officially supported. Great! Time to upgrade the homelab environment!
Upgrading to PostgreSQL 17
In my homelab environment, I’ve had PostgreSQL 15 before the upgrade with TimescaleDB extension version 2.15. Always refer to the official PostgreSQL upgrade manual for upgrade paths.
Note that this is for a stand-alone single node PGSQL database, not a postgresql cluster on a Rocky Linux 9 server.
- Upgrade your Zabbix Server to 7.0.6
dnf update zabbix*
- Upgrade your timescaledb extension
- Upgrading Zabbix with PSQL and TimescaleDB to specific version – Null Byte
- Note: You can upgrade TimescaleDB extension after upgrading PostgreSQL to version 17. In you do it this way, make sure you install the same version of TimescaleDB extension with your new PostgreSQL version that you have currently running!
- Update your PostgreSQL repository
yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-$(rpm -E %{rhel})-x86_64/pgdg-redhat-repo-latest.noarch.rpm
- or edit your vim /etc/yum.repos.d/pgdg-redhat-all.repo and add PostgreSQL 17
- Install PostgreSQL17 with your current PostgreSQL database
dnf install postgresql17-server postgresql17-contrib
- Install TimescaleDB extension for PostgreSQL 17 (Remember to install the same version that you have on your currently running PGSQL Zabbix database!)
dnf install timescaledb-2-postgresql-17.x86_64 timescaledb-2-loader-postgresql-17.x86_64
- Initialize your PostgreSQL 17 database
sudo /usr/pgsql-17/bin/postgresql-17-setup initdb
- Run TimescaleDB tune
timescaledb-tune --pg-config=/usr/pgsql-17/bin/pg_config
- Shutdown Zabbix Server and the old PostgreSQL dabase (Also disable autoboot for the old DB)
systemctl stop zabbix-server
systemctl stop postgresql-15.service
systemctl disable postgresql-15.service
- Upgrade the PostgreSQL Database
/usr/pgsql-17/bin/pg_upgrade -b /usr/pgsql-15/bin -B /usr/pgsql-17/bin -d /var/lib/pgsql/15/data -D /var/lib/pgsql/17/data -j 4
- Note: You will get error messages if you are missing other extensions or they are incorrectly installed and/or loaded before running pg_upgrade
- Start PostgreSQL 17 and Zabbix Server
systemctl enable --now postgresql-17
systemctl start zabbix-server
Hopefully everything went smoothly and you now have newest version of PostgreSQL17 and TimescaleDB extension. Once you’ve verified everything is working properly as expected, remove the old PostgreSQL version and database directory.
dnf remove postgresql15-server postgresql15-contrib timescaledb-2-postgresql-15.x86_64 timescaledb-2-loader-postgresql-15.x86_64
I