Upgrade Zabbix 7.4.16 to 8.0.0 LTS on Ubuntu 26.04 (MariaDB + NGINX)

On this page8 sections

Upgrade Zabbix 7.4.16 to 8.0.0 LTS on Ubuntu 26.04 with MariaDB 11.8 and NGINX. Back up the configuration and database first, then let the server migrate the schema before bringing the frontend back.

Lab context

  • Host: zabbix.maksonlee.com (Ubuntu 26.04, Zabbix 7.4.16 native DEB packages)
  • Database: local MariaDB 11.8.6, zabbix schema
  • Frontend: NGINX + PHP-FPM 8.5.4 at https://zabbix.maksonlee.com/

Prerequisites

  • Use one Bash session on the Zabbix host; the backup path is reused below. Choose an unused path and stop if a command fails.
  • Schedule downtime and allow space for a configuration archive and SQL dump. MariaDB stays running while Zabbix and the web frontend stop.
  • Shut down the VM, take a snapshot, then start it again. A DEB downgrade alone won’t reverse a migrated database.

1. Back up the files

Save the files that the upgrade may replace. The new directory is root-only:

backup=/var/backups/zabbix-8.0-20261115
sudo mkdir -m 700 "$backup"
sudo cp -a /etc/apt/sources.list.d/zabbix*.sources "$backup/"
sudo tar --numeric-owner -C / -czf "$backup/zabbix-files-before.tar.gz" etc/zabbix etc/nginx etc/php/8.5/fpm usr/share/zabbix
sudo chmod 600 "$backup/zabbix-files-before.tar.gz"
sudo gzip -t "$backup/zabbix-files-before.tar.gz"

The last command checks the archive. Continue only if it finishes without an error.

2. Select the 8.0 stable repository

The Ubuntu 26.04 release package switches the APT sources to Zabbix 8.0. Install it, refresh APT, and read the source URIs:

deb="$backup/zabbix-release_latest+ubuntu26.04_all.deb"
sudo curl --fail --location \
  https://repo.zabbix.com/zabbix/8.0/release/ubuntu/pool/main/z/zabbix-release/zabbix-release_latest+ubuntu26.04_all.deb \
  -o "$deb"
sudo dpkg --force-confnew -i "$deb"
sudo apt-get update
grep -E '^(URIs|Enabled):' /etc/apt/sources.list.d/zabbix*.sources

zabbix.sources should point to 8.0/stable, and zabbix-unstable.sources should show Enabled: no. If an old 7.4 source is still active, stop before taking services down.

3. Stop services and dump MariaDB

Stop Zabbix and the web stack. Leave MariaDB active for the database dump:

sudo systemctl stop zabbix-server zabbix-agent2 nginx php8.5-fpm
systemctl is-active mariadb

Use pipefail so a failed mariadb-dump isn’t hidden by a successful gzip. Check the compressed file before installing packages:

set -o pipefail
sudo mariadb-dump \
  --single-transaction --quick --routines --events --triggers --hex-blob \
  --default-character-set=utf8mb4 --databases zabbix \
  | gzip -1 | sudo tee "$backup/zabbix-before.sql.gz" >/dev/null
sudo chmod 600 "$backup/zabbix-before.sql.gz"
sudo gzip -t "$backup/zabbix-before.sql.gz"

Keep the file archive and SQL dump together in the backup directory. Stop if the dump or gzip check fails.

4. Install the five packages

Package scripts may restart services. A temporary guard keeps them stopped during installation. If /usr/sbin/policy-rc.d already exists, stop here. The create command also refuses to overwrite it; don’t continue if it fails:

printf '#!/bin/sh\nexit 101\n' | sudo bash -c 'set -C; cat > /usr/sbin/policy-rc.d'
sudo chmod 755 /usr/sbin/policy-rc.d

Keep the existing component configuration files. At the APT prompt, check for five upgrades to 8.0.0 with no unexpected additions or removals before answering Y:

sudo apt-get install --no-install-recommends \
  -o Dpkg::Options::=--force-confold \
  zabbix-server-mysql zabbix-frontend-php zabbix-nginx-conf \
  zabbix-agent2 zabbix-sql-scripts

5. Complete the database migration

Once APT finishes successfully, test the NGINX and PHP-FPM configurations. Remove only the guard you created in step 4, then start the Zabbix server by itself so it can migrate the database:

sudo nginx -t
sudo php-fpm8.5 -t
sudo rm -- /usr/sbin/policy-rc.d
sudo systemctl start --no-block zabbix-server

Watch /var/log/zabbix/zabbix_server.log for a new database upgrade fully completed line. Then check the schema:

sudo mysql -N -B zabbix -e 'SELECT mandatory,optional FROM dbversion LIMIT 1'

When both fields read 8000000, bring back the frontend and agent:

sudo systemctl start php8.5-fpm nginx zabbix-agent2

6. Verify the upgrade

Check the server version and service state:

zabbix_server -V | sed -n '1p'
systemctl is-active zabbix-server mariadb php8.5-fpm nginx zabbix-agent2

With Zabbix 8.0.0 and all five services active, open your Zabbix URL (https://zabbix.maksonlee.com/ in this example). Check that the frontend loads, latest data is updating, and your usual sign-in works. The existing Keycloak SAML/JIT sign-in was tested after the upgrade and still works.

For the Keycloak integration setup:

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top