Zabbix 2.4 upgrade from patched 2.2.x

por Miguel Martín
Systems Administrator de OpenSistemas

If you patched your Zabbix 2.2.x server to support HTTP headers and SSL stuff and you want to upgrade to official Zabbix 2.4 without loosing previos work, you should do the following.

Important: All the queries are written using MySQL syntax so you will have to adapt them if you use another database server

1. Stop the Zabbix Server.
2. Rename the conflicting column in the database:

ALTER TABLE httpstep CHANGE COLUMN headers headers_2_2_x text NOT NULL;

3. Do the normal upgrade to Zabbix 2.4.0. Once the database upgrade has been completed stop the Zabbix Server again.

4. Now we will drop the new created columns and we will rename 2.2.x related columns to the new names.

ALTER TABLE httptest DROP COLUMN `capath`;
ALTER TABLE httptest DROP COLUMN `ssl_cert_file`;
ALTER TABLE httptest DROP COLUMN `ssl_key_file`;
ALTER TABLE httptest DROP COLUMN `ssl_key_password`;
ALTER TABLE httptest DROP COLUMN `verify_peer`;
ALTER TABLE httptest DROP COLUMN `verify_host`;
ALTER TABLE httpstep DROP COLUMN `headers`;

ALTER TABLE httpstep CHANGE COLUMN `headers_2_2_x` `headers` text NOT NULL;
ALTER TABLE httptest CHANGE COLUMN `certfile` `ssl_cert_file` VARCHAR(255) DEFAULT ” NOT NULL;
ALTER TABLE httptest CHANGE COLUMN `keyfile` `ssl_key_file` VARCHAR(255) DEFAULT ” NOT NULL;
ALTER TABLE httptest CHANGE COLUMN `keypass` `ssl_key_password` VARCHAR(64) DEFAULT ” NOT NULL;
ALTER TABLE httptest CHANGE COLUMN `verifypeer` `verify_peer` INTEGER(11) DEFAULT ‘0’ NOT NULL;
ALTER TABLE httptest CHANGE COLUMN `verifyhost` `verify_host` INTEGER(11) DEFAULT ‘0’ NOT NULL;

5. Be sure you have defined SSLCertLocation SSLKeyLocation and SSLCALocation in zabbix_server.conf
6. Update your web scenario configurations. No more absolute paths as SSL files are now relative to SSL{Cert,Key}Location.
7. Start your zabbix server.

Enjoy!