# Get versions
lsb_release -a
Zabbix_server --version
Zabbix_agentd --version
apache2 -v
php -v
# Take a snapshot of the vm
# Take a backup of:
/etc/apache2/apache2.conf
/etc/apache2/sites-enabled/your.config.conf # 000-default, default-ssl
/etc/zabbix/zabbix_server.conf
/etc/zabbix/zabbix_agentd.conf
/etc/zabbix/apache.conf
/etc/zabbix/web/zabbix.conf.php
# and what not
# example cp
sudo cp zabbix_server.conf zabbix_server.conf_before_os_upgrade
# make a local zabbix user also, if using ldap
sudo apt update
sudo apt upgrade
# and have free space on disk
# restart
sudo do-release-upgrade
# Keep the local version currently installed
# Remove obsolete packages
Example backup files

Must check requirements for Zabbix version (check your version of zabbix, and minimum apache, php etc against the default on 24.04:
Zabbix was running on

Zabbix version 6.0.31 at first
When upgrading from zabbx 6.0.31 to 34 take a backup of
- /etc/zabbix/zabbix_server.conf
- /etc/zabbix/web\zabbix.conf.php

# update current pack
sudo apt update
sudo apt upgrade -y
Say N here, we need to keep the config as is (I said yes at first, and needed to enter password, user and host again for zabbix to work)

If you say Y, it creates a back called zabbix_server.conf.dpkg-old that is what I used to restore configuration.

This went ok as it should.

Reboot server
and Zabbix is running

With new version

And of course Apache is running

Check versions
apache2 -v
Server version: Apache/2.4.52 (Ubuntu)
Server built : 2024-07-17T18:57:26
php -v
PHP 8.1.2-1ubuntu2.19 (cli) (built: Sep 30 2024 16:25:25) (NTS)
lsb_release -a

Pre-upgrade checklist upgrade OS
# Take a backup of:
/etc/apache/apache config
/etc/apache2/sites-enabled/your.config.conf
/etc/zabbix/zabbix_server.conf
/etc/zabbix//web\zabbix.conf.php
sudo apt update
sudo apt upgrade
# and have free space on disk
Upgrade the OS
sudo do-release-upgrade

Y
Continue running under SSH

Y, download and start upgrade (it can take hours, it took 15-30 min)
Configuration changes
During the upgrade process you may be presented with a message to make decisions about package updates. These prompts occur when there are existing configuration files (e.g. edited by the user) and the new package configuration file are different. Below is an example prompt.
You should look at the differences between the files and decide what to do. The default response is to keep the current version of the file. There are situations where accepting the new version, like with /boot/grub/menu.lst, is required for the system to boot correctly with the new kernel.

Another configuration change, N

Apache fails, we will fix it later

69 packages are removed, Y

Upgrade done, Y

After restart
lsb_release -a

Zabbix is running

But apache fail

# Test apache
apache2ctl configtest
apache2: Syntax error on line 146 of /etc/apache2/apache2.conf: Syntax error on line 3 of /etc/apache2/mods-enabled/php8.1.load: Cannot load /usr/lib/apache2/modules/libphp8.1.so into server: /usr/lib/apache2/modules/libphp8.1.so: cannot open shared object file: No such file or directory
# I ran
sudo apt update
# just 3 packages, nothing with apache
sudo apt upgrade -y
# no luck
The fix for apache
kubuntu – Apache2 on 24.04 won’t start when php is installed – Ask Ubuntu
# Your Apache is configured to use PHP 8.1 but you only have PHP 8.3. There are two ways to fix this: configure Apache to use PHP 8.3 or install PHP 8.1.
sudo a2dismod php8.1
sudo a2enmod php8.3
apache2ctl configtest
Syntax OK
sudo systemtctl restart apache2
sudo service apache2 status

Check all versions
imsdal@vmzabbix02:~$ zabbix_server --version
zabbix_server (Zabbix) 6.0.34
Revision 55e9f3b67c4 26 September 2024, compilation time: Sep 26 2024 06:09:13
Copyright (C) 2024 Zabbix SIA
License GPLv2+: GNU GPL version 2 or later <https://www.gnu.org/licenses/>.
This is free software: you are free to change and redistribute it according to
the license. There is NO WARRANTY, to the extent permitted by law.
This product includes software developed by the OpenSSL Project
for use in the OpenSSL Toolkit (http://www.openssl.org/).
Compiled with OpenSSL 3.0.2 15 Mar 2022
Running with OpenSSL 3.0.13 30 Jan 2024
imsdal@vmzabbix02:~$ php -v
PHP 8.3.6 (cli) (built: Sep 30 2024 15:17:17) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.6, Copyright (c) Zend Technologies
with Zend OPcache v8.3.6, Copyright (c), by Zend Technologies
imsdal@vmzabbix02:~$ apache2 -v
Server version: Apache/2.4.58 (Ubuntu)
Server built: 2024-07-17T18:55:23
imsdal@vmzabbix02:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 24.04.1 LTS
Release: 24.04
Codename: noble
Check zabbix

Check a graf

Restart server

Perfect

Update 08.11.2024
Scenario X, you are app manager, but a different team is infra manager upgrade os included update the /etc/apt/sources.list.d/zabbix.list
# Scenario X, you are app manager, but a different team is infra manager.
sudo apt update -y
sudo apt upgrade -y
# if you get apache 2 error disable version and enable new
sudo a2dismod php7.4
sudo a2enmod php8.3
apache2ctl configtest (if this fails, it could be due to cert.key, just cp)
sudo service apache2 stop
sudo service apache2 start
sudo service apache2 status
# check versions, if
zabbix_server --version
zabbix_agentd --version
# returns no version, it is removed to due OS upgrade.
# install the missing componets
# arm, not arm64
# get zabbix server agent and for mysql again and correct os, in this case 24.4
wget https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_latest_6.0+ubuntu24.04_all.deb
sudo dpkg -i zabbix-release_latest_6.0+ubuntu24.04_all.deb
# Y, this is for new version of config file /etc/apt/sources.list.d/zabbix.list
# so next time if there is a minor update, we get it from correct repos
sudo apt update and upgrade
sudo apt install zabbix-server-mysql --no-install-recommends
#Y
sudo apt install zabbix-agent
# Y
sudo systemctl enable zabbix-server zabbix-agent apache2
# check enabled if needed
sudo systemctl is-enabled apache
sudo systemctl is-enabled zabbix-server
sudo systemctl is-enabled zabbix-agent
# verify all version after and restart server
wget https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_latest_6.0+ubuntu24.04_all.deb
