3 Upgrade from containers
Overview
This section describes the steps required for a successful upgrade to Zabbix 7.4.x containers.
Separate sets of instructions are available for:
Before the upgrade make sure to read the relevant upgrade notes!
Before starting the upgrade, verify that users have the necessary permissions to the database for upgrading purposes.
For upgrades from Zabbix 6.0 or older, deterministic triggers will need to be created during the upgrade.
If binary logging is enabled for MySQL/MariaDB, this requires superuser privileges or setting the variable/configuration parameter log_bin_trust_function_creators = 1.
See Database creation scripts for instructions how to set the variable.
Note that if executing from a console, the variable will only be set temporarily and will be dropped when a Docker is restarted.
In this case, keep your SQL service running, only stop zabbix-server service by running docker compose down zabbix-server and then docker compose up -d zabbix-server.
Alternatively, you can set this variable in the configuration file.
Depending on the database size, the database upgrade to version 7.4 may take a long time.
Zabbix component image upgrade
These instructions upgrade your Docker images used as a base for your Zabbix component containers.
The steps below use a Zabbix proxy as an example.
Replace zabbix-proxy-sqlite3 with your component's container name.
1. Check all containers to identify their names and current image versions:
docker ps -a
# CONTAINER ID IMAGE (...) NAMES
# 5a0c2e3d02b4 zabbix/zabbix-proxy-sqlite3:alpine-7.2-latest (...) zabbix-proxy-sqlite3
2. Pull the new image version:
docker pull zabbix/zabbix-proxy-sqlite3:alpine-7.4-latest
3. Stop the Zabbix component container:
docker stop zabbix-proxy-sqlite3
4. Remove the Zabbix component container:
Make sure you have noted all configuration flags and volume mounts used in the original docker run command before proceeding, as they will be needed to recreate the container.
docker rm zabbix-proxy-sqlite3
5. Start a new container using the updated image:
docker run --name zabbix-proxy-sqlite3 \
-e ZBX_SERVER_HOST=192.0.2.0 \
-e ZBX_PROXYMODE=0 \
-e ZBX_HOSTNAME=zabbix-proxy-sqlite3 \
-v zabbix-proxy-data:/var/lib/zabbix/db_data \
--init \
-d \
zabbix/zabbix-proxy-sqlite3:alpine-7.4-latest
For more information on running Zabbix containers, see Docker (manual deployment).
6. Verify that the upgrade was successful by checking the container logs:
docker logs -f zabbix-proxy-sqlite3
Docker Compose file upgrade
These instructions upgrade the Docker Compose files used for deploying Zabbix components. Follow these instructions if you installed Zabbix using Docker Compose.
1. Check all containers to identify their names and current image versions:
docker ps -a
# CONTAINER ID IMAGE (...) NAMES
# d095f486deef zabbix/zabbix-server-mysql:alpine-7.2-latest (...) zabbix-docker-zabbix-server-1
# 70627d833da0 zabbix/zabbix-web-nginx-mysql:alpine-7.2-latest (...) zabbix-docker-zabbix-web-nginx-mysql-1
# aaaa664cc185 zabbix/zabbix-server-mysql:alpine-7.2-latest (...) zabbix-docker-server-db-init-1
# 9ab3e77492ff mysql:8.0-oracle (...) zabbix-docker-mysql-server-1
2. Navigate to the Zabbix Docker repository you previously cloned, pull the latest updates, and switch to the 7.4 branch:
If you have modified .env, compose.yaml, or other files in your local repository, a git pull may overwrite them.
Back up any local changes before running this step.
cd zabbix-docker
git pull
git checkout 7.4
3. Deploy Zabbix components using the updated Docker Compose file:
# With MySQL as the database:
docker compose -f ./compose.yaml up -d
# With PostgreSQL as the database:
docker compose -f ./compose_pgsql.yaml up -d
After all containers are recreated and started, it may take 1—3 minutes before data collection resumes. For more information on running Zabbix containers, see Docker Compose.
4. Verify that the upgrade was successful by checking the container logs (replace zabbix-docker-zabbix-server-1 with the name of your component's container):
docker logs -f zabbix-docker-zabbix-server-1