How to upgrade Zabbix from 1.8.x to 2.0.x


http://www.zabbix.com/documentation/2.0/manual/installation/upgrade_notes
http://www.zabbix.com/documentation/2.0/manual/installation/upgrade?s[]=upgrade

Upgraded from 1.8.2 to 2.0.2.

1. Stop Zabbix server
$ su – zabbix
$ sudo /etc/init.d/zabbix_server stop

2. Back up the existing Zabbix database
$ mkdir -p /home/zabbix/zabbix_upgrade/backup
$ cd /home/zabbix/zabbix_upgrade/backup
$ mysqldump -uroot -pzabbixadmin zabbix > zabbix.backup.sql

3. Back up configuration files, PHP files and zabbix binaries
$ cp -rp /etc/zabbix .
$ cp -rp /home/zabbix/public_html .
$ cp -rp /etc/init.d/zabbix-* .
$ cp -rp /usr/sbin/zabbix* .
$ cp -rp /usr/bin/zabbix* .

4. Install new server binaries
Download zabbix-2.0.2.tar.gz from website.
$ cd /home/zabbix/zabbix_upgrade/
$ tar xzvf zabbix-2.0.2.tar.gz
$ cd zabbix-2.0.2
$ ./configure –prefix=/usr –with-mysql –with-net-snmp –with-libcurl –enable-server –enable-agent
$ make
$ sudo make install
$ sudo zabbix_server –help
Zabbix server v2.0.2 (revision 29214) …

5. Review server configuration parameters
$ cd /usr/etc/
$ sudo cp -rp /home/zabbix/zabbix_upgrade/backup/zabbix/zabbix_* .

6. Upgrade the database
Clean the history data:
$date +%s -d “2012/9/1 00:00:00”
1346428800

mysql> DELETE FROM `history_uint` WHERE `clock` < 1346428800; mysql> optimize table history_uint;

mysql> DELETE FROM `history` WHERE `clock` < 1346428800; mysql> optimize table history;

$ cd /home/zabbix/zabbix_upgrade/zabbix-2.0.2/upgrades/dbpatches/2.0/mysql
$ mysql -uroot -p123456 zabbix < patch.sql 7. Install new Zabbix web interface $ cd /home/zabbix/zabbix_upgrade/ $ sudo mv /home/zabbix/public_html /home/zabbix/public_html_bak $ sudo mkdir /home/zabbix/public_html $ sudo chown -R zabbix:zabbix /home/zabbix/public_html $ cp -r zabbix-2.0.2/frontends/php/* /home/zabbix/public_html/ 8. Start new Zabbix binaries $ /etc/init.d/zabbix-server start $ ps aux | grep zabbix_server Open the webpage http://IP/zabbix/ Then follow the steps to setup the Zabbix WebUI. Download the zabbix.conf.php and put it into /home/zabbix/public_html/conf/ Restart Zabbix server $ /etc/init.d/zabbix-server stop $ /etc/init.d/zabbix-server start 9. Upgrade Zabbix agent clients We don't have to upgrade all Zabbix agent clients, but we'd better to do it if we can. Download zabbix-2.0.2.tar.gz from website. $ sudo /etc/init.d/zabbix_agentd stop $ mkdir -p /home/zabbix/zabbix_upgrade/backup $ cd /home/zabbix/zabbix_upgrade/backup $ cp -rp /etc/zabbix . $ cp -rp /etc/init.d/zabbix-* . $ cp -rp /usr/sbin/zabbix* . $ cp -rp /usr/bin/zabbix* . $ cd /home/zabbix/zabbix_upgrade/ $ tar xzvf zabbix-2.0.2.tar.gz $ cd zabbix-2.0.2 $ ./configure --prefix=/usr --with-net-snmp --with-libcurl --enable-agent $ make $ sudo make install $ cd /usr/etc/ $ sudo cp -rp /home/zabbix/zabbix_upgrade/backup/zabbix/zabbix_* . $ sudo zabbix_agent --help Zabbix agent v2.0.2 (revision 29214) ... $ sudo /etc/init.d/zabbix_agentd start 10. Done 11. Something we should pay attention Configuration files location changed: /etc/zabbix → /usr/etc But except the /etc/zabbix/alert.d/. {IPADDRESS} macro deprecated, use {HOST.IP}

  1. #1 by Abdel-Mawla on May 9, 2014 - 5:29 pm

    Good article (y)
    One thing I would like to mention here. You can use the option “–sysconfdir=/etc/zabbix/” in the ./configure command to keep the configuration files location the same.

    • #2 by mcsrainbow on May 11, 2014 - 12:58 am

      OK, thanks.

  2. #3 by Rajender on December 4, 2014 - 7:26 pm

    Thanks for the article, really helped me a lot.

  3. #4 by Rajender on December 4, 2014 - 7:28 pm

    Hi,
    I want to install zabbix in some other directory(User Defined directory like /data/zabbix) what prefix should I add to ./configure command?

(will not be published)

*


Fork me on GitHub