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.

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

Current Zabbix Installation

<code># 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</code>

Backup Procedures

Backup configuration files :

<code>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/</code>

Backup the database (full):

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

Partial backup (excluding history tables):

<code>#!/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</code>

Upgrade Steps

1. Stop Zabbix and Nginx services:

<code>systemctl stop zabbix-server && systemctl stop nginx</code>

2. Remove old web packages:

<code>yum remove zabbix-web-*</code>

3. Install the Red Hat Software Collections (SCL) repository:

<code>yum install centos-release-scl</code>

4. Update Zabbix repository packages:

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

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

<code>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</code>

6. Disable old nginx and php‑fpm services:

<code>systemctl stop nginx php-fpm
systemctl disable nginx php-fpm</code>

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:

<code>systemctl restart rh-nginx116-nginx rh-php72-php-fpm
systemctl enable rh-nginx116-nginx rh-php72-php-fpm</code>

10. Start Zabbix server:

<code>systemctl start zabbix-server</code>

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/

.

MonitoringphpupgradeCentOSZabbix
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

login 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.