Upgrade from containers

Overview

This section describes steps required for a successful upgrade from Zabbix 6.2.x containers to Zabbix 6.4.x containers.

Separate sets of instructions are available for upgrading individual Zabbix component images and Docker compose files.

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.

Depending on the size of a database upgrade to version 6.4 may take quite a long time.

Zabbix image upgrade

The steps listed below can be used to upgrade any Zabbix component. Replace zabbix-server-mysql with the required component image name.

\1. Check current image version:

  1. docker inspect -f '{{ .Config.Image }}' zabbix-server-mysql

\2. Pull desired image version, for example:

  1. docker pull zabbix/zabbix-server-mysql:alpine-6.4-latest

zabbix/zabbix-server-mysql:alpine-6.4-latest will pull the latest released minor version of Zabbix server 6.4 with MySQL support based on Alpine Linux. Replace it with the name of the Docker repository and tags combination you need. See Installation from containers for a list of available options.

\3. Stop the container:

  1. docker stop zabbix-server-mysql

\4. Remove the container:

  1. docker rm zabbix-server-mysql

\5. Launch the updated container by executing docker run command followed by additional arguments to specify required environment variables and/or mount points.

Configuration examples

Zabbix server with MySQL:

  1. docker run --name zabbix-server-mysql -t \
  2. -e DB_SERVER_HOST="mysql-server" \
  3. -e MYSQL_DATABASE="zabbix" \
  4. -e MYSQL_USER="zabbix" \
  5. -e MYSQL_PASSWORD="zabbix_pwd" \
  6. -e MYSQL_ROOT_PASSWORD="root_pwd" \
  7. -e ZBX_JAVAGATEWAY="zabbix-java-gateway" \
  8. --network=zabbix-net \
  9. -p 10051:10051 \
  10. --restart unless-stopped \
  11. -d zabbix/zabbix-server-mysql:alpine-6.4-latest

Zabbix server with PostgreSQL:

  1. docker run --name zabbix-server-mysql -t \
  2. -e DB_SERVER_HOST="postgres-server" \
  3. -e POSTGRES_USER="zabbix" \
  4. -e POSTGRES_PASSWORD="zabbix_pwd" \
  5. -e POSTGRES_DB="zabbix" \
  6. -e ZBX_ENABLE_SNMP_TRAPS="true" \
  7. --network=zabbix-net \
  8. -p 10051:10051 \
  9. --volumes-from zabbix-snmptraps \
  10. --restart unless-stopped \
  11. -d zabbix/zabbix-server-pgsql:alpine-6.4-latest

More configuration examples, including examples for other Zabbix components, are available on the Installation from containers page.

  1. Verify the update:

    docker logs -f zabbix-server-mysql

Compose files

Follow upgrade instructions in this section, if you installed Zabbix using compose file.

\1. Check current image version:

  1. docker inspect -f '{{ .Config.Image }}' zabbix-server-mysql

\2. Pull the latest updates from the GitHub repository and switch to the required branch:

  1. git pull
  2. git checkout 6.4

\3. Start Zabbix components using new compose file:

  1. docker-compose -f ./docker-compose_v3_alpine_mysql_latest.yaml up -d

\4. Verify the update:

  1. docker logs -f zabbix-server-mysql

See Installation from containers for more details, including lists of supported environment variables and volume mount points.