About Zabbix Server
Zabbix is a free and open source network monitoring Software tool which is used to monitor and track the availability and performance of your IT infrastracture: servers, network devices and other IT assets.
In this tutorial we will cover how to upgrade Zabbix Server 3.4.x to 4.0.x on Ubuntu 16.04 LTS or Ubuntu 18.04 LTS. those steps can be used also to upgrade Zabbix Server 3.2.x to 3.4.x or to 4.0.x.
1./ Stop Zabbix Server Daemon
– Stop Zabbix Server to make sure that no new data is inserted into database:
# systemctl stop zabbix-server
2./ Back up the existing Zabbix database
– Create a directory where we will backup the Zabbix Server database and configuration Files:
# mkdir /opt/zabbix-backup/
– Use the following command to backup the Zabbix Server database, replace zabbixdb with the name of your Zabbix Server database:
# mysqldump -u root -p zabbixdb > /opt/zabbix-backup/zabbixdb.sql Enter password:
3./ Back up configuration files, PHP files and Zabbix binaries
– To backup the Zabbix Server configuration files use the following command:
# cp /etc/zabbix/zabbix_server.conf /opt/zabbix-backup/ # cp /etc/zabbix/zabbix_agentd.conf /opt/zabbix-backup/ # cp /etc/apache2/conf-enabled/zabbix.conf /opt/zabbix-backup/
– To backup the PHP files and Zabbix Server binaries use the following command:
# cp -R /usr/share/zabbix/ /opt/zabbix-backup/ # cp -R /usr/share/doc/zabbix-* /opt/zabbix-backup/
4./ Update Zabbix Server repository configuration package
– Uninstall your current Zabbix release repository as below:
# rm -Rf /etc/apt/sources.list.d/zabbix.list
– Download the Zabbix repository package release:
# wget https://repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.0-2+xenial_all.deb --2018-10-07 20:49:10-- https://repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.0-2+xenial_all.deb Resolving repo.zabbix.com (repo.zabbix.com)... 188.8.131.52 Connecting to repo.zabbix.com (repo.zabbix.com)|184.108.40.206|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 3930 (3.8K) [application/octet-stream] Saving to: ‘zabbix-release_4.0-2+xenial_all.deb’ zabbix-release_4.0-2+xenial_all.deb 100%[==================================================================================>] 3.84K --.-KB/s in 0s 2018-10-07 20:49:11 (166 MB/s) - ‘zabbix-release_4.0-2+xenial_all.deb’ saved [3930/3930]
– Upgrade the Zabbix current repository package release as below:
# dpkg -i zabbix-release_4.0-1+xenial_all.deb dpkg: error processing archive zabbix-release_4.0-1+xenial_all.deb (--install): cannot access archive: No such file or directory Errors were encountered while processing: zabbix-release_4.0-1+xenial_all.deb root@ylplzbx01:~# dpkg -i zabbix-release_4.0-2+xenial_all.deb (Reading database ... 252597 files and directories currently installed.) Preparing to unpack zabbix-release_4.0-2+xenial_all.deb ... Unpacking zabbix-release (1:4.0-2+xenial) over (3.4-1+xenial) ... Setting up zabbix-release (1:4.0-2+xenial) ... Configuration file '/etc/apt/sources.list.d/zabbix.list' ==> Deleted (by you or by a script) since installation. ==> Package distributor has shipped an updated version. What would you like to do about it ? Your options are: Y or I : install the package maintainer's version N or O : keep your currently-installed version D : show the differences between the versions Z : start a shell to examine the situation The default action is to keep your current version. *** zabbix.list (Y/I/N/O/D/Z) [default=N] ? Y Installing new version of config file /etc/apt/sources.list.d/zabbix.list ...
– Finaly, update the repository information using the following command:
# apt-get update
5./ Upgrade Zabbix Server components
– To upgrade Zabbix Server components, run the following command:
# apt-get install --only-upgrade zabbix-server-mysql zabbix-frontend-php zabbix-agent
– After upgrading the zabbix Server components, make sure to reconfigure the Zabbix Server config file zabbix_server.conf, the apache2 configuration file zabbix.conf like before.
6./ Start Zabbix Server Daemon
# systemctl start zabbix-server
We hope this tutorial was enough helpful. If you need more information, or have any questions, just comment below and we will be glad to assist you!
PS. If you like this post please share it with your friends on the social networks using the buttons below.Thanks.