Update Zabbix instance from 3.4 to 4.0, CentOS 7

Upgrade from 3.4 will require the free disk space as there is size of events table:
SELECT table_name, table_rows, data_length, index_length, round(((data_length + index_length) / 1024 / 1024),2) "Size in MB" FROM information_schema.tables WHERE table_schema = "zabbix" and table_name = "events" order by round(((data_length + index_length) / 1024 / 1024),2);
Plan you proxies to update. Find out exact steps to use for proxies update.

backup database
#!/bin/bash

#set timestamp in variable
time=$(date +%Y%m%d%H%M)

echo creating mysqldump..
sudo mysqldump -uroot -p5sRj4GXspvDKsBXW --flush-logs --single-transaction --create-options zabbix | bzip2 -9 > /root/all.$time.bz2
# https://dev.mysql.com/doc/refman/5.5/en/mysqldump.html
# --flush-logs          Flush MySQL server log files before starting dump
# --single-transaction  Issue a BEGIN SQL statement before dumping data from server
# --create-options      Include all MySQL-specific table options in CREATE TABLE statements
Remove old zabbix repo:
yum remove zabbix-release
Install new repo
rpm -ivh http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
Clean cache:
yum clean all && rm -rf /var/cache/yum
Make new cache:
yum makecache
Optional: empty zabbix server log:
cp /var/log/zabbix/zabbix_server.log ~
> /var/log/zabbix/zabbix_server.log
Update:
yum update
check log for any errors:
cat /var/log/zabbix/zabbix_server.log
Log out existing web browser session. Clear browser cache.

No comments: