Operations 8 min read

How to Upgrade Zabbix to 5.0.0beta1 on CentOS 7: Step‑by‑Step Guide

This guide walks you through the full upgrade of Zabbix to version 5.0.0beta1 on a CentOS 7 system, covering required PHP and database versions, backup procedures, repository setup, package installation, configuration adjustments, and service restart to ensure a smooth transition.

Ops Development Stories
Ops Development Stories
Ops Development Stories
How to Upgrade Zabbix to 5.0.0beta1 on CentOS 7: Step‑by‑Step Guide

Upgrade Requirements

Zabbix 5.0.0beta1 requires PHP 7.2 or higher and supports the following database versions: MySQL 5.5.62, MariaDB 10.0.37, PostgreSQL 9.2.24, and Oracle 11.2. Official upgrade documentation can be found at Zabbix 5.0 Upgrade Docs .

System Environment

Operating system: CentOS 7.6 (Core). Nginx version 1.16.1.

# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
# nginx -v
nginx version: nginx/1.16.1

Current Zabbix Installation

# rpm -qa | grep zabbix
zabbix-server-mysql-4.2.6-1.el7.x86_64
zabbix-web-mysql-4.2.6-1.el7.noarch
zabbix-get-4.2.6-1.el7.x86_64
zabbix-web-mysql-4.2.6-1.el7.noarch
zabbix-release-4.2-1.el7.noarch
zabbix-agent-4.2.6-1.el7.x86_64

Backup Procedures

Backup configuration files :

mkdir /zabbix-backup
cp /etc/zabbix/zabbix_server.conf /zabbix-backup/
cp /etc/zabbix/zabbix_agentd.conf /zabbix-backup/
cp /etc/zabbix/web/zabbix.conf.php /zabbix-backup/
cp -R /usr/share/zabbix/ /zabbix-backup/
cp -R /usr/share/doc/zabbix-* /zabbix-backup/

Backup the database (full):

mysqldump -uzabbix -pzabbix@zabbix --opt --skip-lock-tables zabbix | gzip > /opt/zabbix_$(date +%Y%m%d_%H%M%S).sql.gz

Partial backup (excluding history tables):

#!/bin/bash
/usr/bin/mysqldump -uzabbix -pzabbix@zabbix zabbix \
  --ignore-table=zabbix.history \
  --ignore-table=zabbix.history_str \
  --ignore-table=zabbix.history_uint \
  --ignore-table=zabbix.trends \
  --ignore-table=zabbix.trends_uint \
  > /opt/zabbix$(date +%y%m%d)-172.18.30.27.sql

Upgrade Steps

1. Stop Zabbix and Nginx services:

systemctl stop zabbix-server && systemctl stop nginx

2. Remove old web packages: yum remove zabbix-web-* 3. Install the Red Hat Software Collections (SCL) repository: yum install centos-release-scl 4. Update Zabbix repository packages:

rpm -Uvh https://repo.zabbix.com/zabbix/4.5/rhel/7/x86_64/zabbix-release-4.5-2.el7.noarch.rpm
yum clean all

5. Install required SCL packages and Zabbix 5.0.0beta1 front‑end:

yum install zabbix-web-deps-scl-5.0.0beta1.el7.noarch.rpm
yum install zabbix-web-5.0.0beta1.el7.noarch.rpm
yum install zabbix-web-mysql-scl-5.0.0beta1.el7.noarch.rpm
yum install zabbix-nginx-conf-scl-5.0.0beta1.el7.noarch.rpm

6. Disable old nginx and php‑fpm services:

systemctl stop nginx php-fpm
systemctl disable nginx php-fpm

7. Edit PHP‑FPM configuration (change timezone) at /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf.

8. Edit Nginx configuration to enable listen and server_name in /opt/rh/rh-nginx116/nginx/conf.d/zabbix.conf.

9. Restart and enable the new services:

systemctl restart rh-nginx116-nginx rh-php72-php-fpm
systemctl enable rh-nginx116-nginx rh-php72-php-fpm

10. Start Zabbix server:

systemctl start zabbix-server

Verification

After the upgrade, verify the new UI. Zabbix 5.0 introduces a vertical sidebar menu, redesigned front‑end, host monitoring module, test button for items, and moved SNMP credentials to host interfaces.

Note: Files for the rh-php72 collection are located under /etc/opt/rh/rh-php72/ and logs under /var/opt/rh/rh-php72/log/.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

PHPCentOSZabbix
Ops Development Stories
Written by

Ops Development Stories

Maintained by a like‑minded team, covering both operations and development. Topics span Linux ops, DevOps toolchain, Kubernetes containerization, monitoring, log collection, network security, and Python or Go development. Team members: Qiao Ke, wanger, Dong Ge, Su Xin, Hua Zai, Zheng Ge, Teacher Xia.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.