1.备份旧的ZABBIX数据库

mysqldump -uroot -p zabbix -pYou_DBPasswd> /root/sunday/zabbix.sql

2.部署好新的ZABBIX环境并完成安装

3.导入旧的ZABBIX数据库文件

导入之后需要修改下数据库版本:

 update dbversion set mandatory=4020000;
 FLUSH PRIVILEGES;

3.启动新的ZABBIX-SERVER并查看启动日志

tailf /tmp/zabbix_server.log

即可看到ZABBIX DATABASE升级的进度条:

进度条

若在升级过程中遇到如下报错问题:

  8552:20191022:004024.576 [Z3005] query failed: [1050] Table 'dashboard' already exists [create table dashboard (
`dashboardid` bigint unsigned not null,
`name` varchar(255) not null,
`userid` bigint unsigned not null,
`private` integer default '1' not null,
primary key (dashboardid)
) engine=innodb]
  8552:20191022:004024.576 database upgrade failed

删除表dashboard,重新启动ZABBIX-SERVER重试即可

mysql> drop tables dashboard;

至此完成ZABBIX版本更新

Last modification:October 23rd, 2019 at 10:43 am