Hi, anybody know when I installed zabbix 1.5.3 server w/ mysql server, do I run upgrades/dbpatches/1.6/mysql/patch.sql , or any patch for the 1.5.3 database tables to 1.6 database tables?
Ad Widget
Collapse
upgrade zabbix from 1.5.x to 1.6
Collapse
X
-
Hi, here is a similar thread:
HTH, Luie -
May be I can successful to upgrade the zabbix form 1.5.3 to 1.6 as the below sql script, this is copy from the patch.sql then I run it step by step, I don't know is it correct or not, but at least the zabbix_server.log no any error now.
-------------------------------------------------------
alter table alerts drop index alerts_1;
alter table alerts drop index alerts_2;
alter table alerts drop index alerts_3;
alter table alerts drop index alerts_4;
alter table alerts drop index alerts_5;
alter table alerts drop index alerts_6;
CREATE INDEX alerts_1 on alerts (actionid);
CREATE INDEX alerts_2 on alerts (clock);
CREATE INDEX alerts_3 on alerts (eventid);
CREATE INDEX alerts_4 on alerts (status,retries);
CREATE INDEX alerts_5 on alerts (mediatypeid);
CREATE INDEX alerts_6 on alerts (userid);
update alerts set status=3 where retries>=2;
alter table dhosts modify ip varchar(39) NOT NULL default '';
alter table events drop index events_1;
alter table events drop index events_2;
CREATE INDEX events_1 on events (object,objectid,eventid);
CREATE INDEX events_2 on events (clock);
alter table graphs_items change color color varchar(32) DEFAULT '009600' NOT NULL;
alter table graphs add percent_left double(16,4) DEFAULT '0' NOT NULL;
alter table graphs add percent_right double(16,4) DEFAULT '0' NOT NULL;
CREATE TABLE hosts_profiles_ext (
hostid bigint unsigned DEFAULT '0' NOT NULL,
device_alias varchar(64) DEFAULT '' NOT NULL,
device_type varchar(64) DEFAULT '' NOT NULL,
device_chassis varchar(64) DEFAULT '' NOT NULL,
device_os varchar(64) DEFAULT '' NOT NULL,
device_os_short varchar(64) DEFAULT '' NOT NULL,
device_hw_arch varchar(32) DEFAULT '' NOT NULL,
device_serial varchar(64) DEFAULT '' NOT NULL,
device_model varchar(64) DEFAULT '' NOT NULL,
device_tag varchar(64) DEFAULT '' NOT NULL,
device_vendor varchar(64) DEFAULT '' NOT NULL,
device_contract varchar(64) DEFAULT '' NOT NULL,
device_who varchar(64) DEFAULT '' NOT NULL,
device_status varchar(64) DEFAULT '' NOT NULL,
device_app_01 varchar(64) DEFAULT '' NOT NULL,
device_app_02 varchar(64) DEFAULT '' NOT NULL,
device_app_03 varchar(64) DEFAULT '' NOT NULL,
device_app_04 varchar(64) DEFAULT '' NOT NULL,
device_app_05 varchar(64) DEFAULT '' NOT NULL,
device_url_1 varchar(255) DEFAULT '' NOT NULL,
device_url_2 varchar(255) DEFAULT '' NOT NULL,
device_url_3 varchar(255) DEFAULT '' NOT NULL,
device_networks blob NOT NULL,
device_notes blob NOT NULL,
device_hardware blob NOT NULL,
device_software blob NOT NULL,
ip_subnet_mask varchar(39) DEFAULT '' NOT NULL,
ip_router varchar(39) DEFAULT '' NOT NULL,
ip_macaddress varchar(64) DEFAULT '' NOT NULL,
oob_ip varchar(39) DEFAULT '' NOT NULL,
oob_subnet_mask varchar(39) DEFAULT '' NOT NULL,
oob_router varchar(39) DEFAULT '' NOT NULL,
date_hw_buy varchar(64) DEFAULT '' NOT NULL,
date_hw_install varchar(64) DEFAULT '' NOT NULL,
date_hw_expiry varchar(64) DEFAULT '' NOT NULL,
date_hw_decomm varchar(64) DEFAULT '' NOT NULL,
site_street_1 varchar(128) DEFAULT '' NOT NULL,
site_street_2 varchar(128) DEFAULT '' NOT NULL,
site_street_3 varchar(128) DEFAULT '' NOT NULL,
site_city varchar(128) DEFAULT '' NOT NULL,
site_state varchar(64) DEFAULT '' NOT NULL,
site_country varchar(64) DEFAULT '' NOT NULL,
site_zip varchar(64) DEFAULT '' NOT NULL,
site_rack varchar(128) DEFAULT '' NOT NULL,
site_notes blob NOT NULL,
poc_1_name varchar(128) DEFAULT '' NOT NULL,
poc_1_email varchar(128) DEFAULT '' NOT NULL,
poc_1_phone_1 varchar(64) DEFAULT '' NOT NULL,
poc_1_phone_2 varchar(64) DEFAULT '' NOT NULL,
poc_1_cell varchar(64) DEFAULT '' NOT NULL,
poc_1_screen varchar(64) DEFAULT '' NOT NULL,
poc_1_notes blob NOT NULL,
poc_2_name varchar(128) DEFAULT '' NOT NULL,
poc_2_email varchar(128) DEFAULT '' NOT NULL,
poc_2_phone_1 varchar(64) DEFAULT '' NOT NULL,
poc_2_phone_2 varchar(64) DEFAULT '' NOT NULL,
poc_2_cell varchar(64) DEFAULT '' NOT NULL,
poc_2_screen varchar(64) DEFAULT '' NOT NULL,
poc_2_notes blob NOT NULL,
PRIMARY KEY (hostid)
) type=InnoDB;
alter table hosts modify ip varchar(39) DEFAULT '127.0.0.1' NOT NULL;
alter table hosts add useipmi integer DEFAULT '0' NOT NULL;
alter table hosts add ipmi_port integer DEFAULT '623' NOT NULL;
alter table hosts add ipmi_authtype integer DEFAULT '0' NOT NULL;
alter table hosts add ipmi_privilege integer DEFAULT '2' NOT NULL;
alter table hosts add ipmi_username varchar(16) DEFAULT '' NOT NULL;
alter table hosts add ipmi_password varchar(20) DEFAULT '' NOT NULL;
alter table hosts add ipmi_disable_until integer DEFAULT '0' NOT NULL;
alter table hosts add ipmi_available integer DEFAULT '0' NOT NULL;
alter table hosts add snmp_disable_until integer DEFAULT '0' NOT NULL;
alter table hosts add snmp_available integer DEFAULT '0' NOT NULL;
CREATE INDEX hosts_3 on hosts (proxy_hostid);
alter table httpstep modify url varchar(255) DEFAULT '' NOT NULL;
CREATE INDEX httptest_httptest_1 on httptest (applicationid);
delete from ids;
alter table items add ipmi_sensor varchar(128) DEFAULT '' NOT NULL;
CREATE INDEX items_4 on items (templateid);
drop table node_cksum;
CREATE TABLE node_cksum (
nodeid integer DEFAULT '0' NOT NULL,
tablename varchar(64) DEFAULT '' NOT NULL,
recordid bigint unsigned DEFAULT '0' NOT NULL,
cksumtype integer DEFAULT '0' NOT NULL,
cksum text DEFAULT '' NOT NULL,
sync char(128) DEFAULT '' NOT NULL
) type=InnoDB;
CREATE INDEX node_cksum_cksum_1 on node_cksum (nodeid,tablename,recordid,cksumtype);
alter table nodes modify ip varchar(39) DEFAULT '' NOT NULL;
drop table profiles;
CREATE TABLE profiles (
profileid bigint unsigned DEFAULT '0' NOT NULL,
userid bigint unsigned DEFAULT '0' NOT NULL,
idx varchar(96) DEFAULT '' NOT NULL,
idx2 bigint unsigned DEFAULT '0' NOT NULL,
value_id bigint unsigned DEFAULT '0' NOT NULL,
value_int integer DEFAULT '0' NOT NULL,
value_str varchar(255) DEFAULT '' NOT NULL,
source varchar(96) DEFAULT '' NOT NULL,
type integer DEFAULT '0' NOT NULL,
PRIMARY KEY (profileid)
) type=InnoDB;
CREATE INDEX profiles_1 on profiles (userid,idx,idx2);
alter table rights drop type;
alter table services modify goodsla double(16,4) DEFAULT '99.9' NOT NULL;
alter table sessions add status integer DEFAULT '0' NOT NULL;
alter table sysmaps_elements add iconid_disabled bigint unsigned DEFAULT '0' NOT NULL;
;Comment
-
update sysmaps_link_triggers set color='FF0000' where color='Red';
update sysmaps_link_triggers set color='960000' where color='Dark Red';
update sysmaps_link_triggers set color='00FF00' where color='Green';
update sysmaps_link_triggers set color='009600' where color='Dark Green';
update sysmaps_link_triggers set color='0000FF' where color='Blue';
update sysmaps_link_triggers set color='000096' where color='Dark Blue';
update sysmaps_link_triggers set color='FFFF00' where color='Yellow';
update sysmaps_link_triggers set color='969600' where color='Dark Yellow';
update sysmaps_link_triggers set color='00FFFF' where color='Cyan';
update sysmaps_link_triggers set color='000000' where color='Black';
update sysmaps_link_triggers set color='969696' where color='Gray';
update sysmaps_link_triggers set color='FFFFFF' where color='White';
update sysmaps_links set color='FF0000' where color='Red';
update sysmaps_links set color='960000' where color='Dark Red';
update sysmaps_links set color='00FF00' where color='Green';
update sysmaps_links set color='009600' where color='Dark Green';
update sysmaps_links set color='0000FF' where color='Blue';
update sysmaps_links set color='000096' where color='Dark Blue';
update sysmaps_links set color='FFFF00' where color='Yellow';
update sysmaps_links set color='969600' where color='Dark Yellow';
update sysmaps_links set color='00FFFF' where color='Cyan';
update sysmaps_links set color='000000' where color='Black';
update sysmaps_links set color='969696' where color='Gray';
update sysmaps_links set color='FFFFFF' where color='White';
update triggers set comments='' where comments is null;
alter table triggers modify comments blob DEFAULT '' NOT NULL;
update users set passwd='5fce1b3e34b520afeffb37ce08c7cd66' where alias<>'guest' and passwd='d41d8cd98f00b204e9800998ecf8427e'Comment
-
-------------------------------------------------------------------------
This SQL script for fix the probelm for some issue:
alter table escalations add r_eventid bigint unsigned DEFAULT '0' NOT NULL;
update functions set lastvalue=0 where lastvalue is null;Comment
-
I upgraded from 1.5.3 (BETA) to 1.6.1 on MySQL in this way:
1) /etc/init.d/zabbix-server stop
2) mysqldump --databases zabbix -u <user> -p<password> > zabbix_db_pre_update.sql
3) recompiled sources
4) opened 2 ssh sessions (A and B below):A) vi patch.sql
B) mysql -u<user> -p<password> zabbix
I) from session A copy <N> lines
II) past lines, you copied before, into session B.
III) repeat I) and II) until EOF of patch.sql
(in this way it skips errors like "ERROR 1060 (42S21): Duplicate column name '<colum_name>'" and upgrades only tables you really need to be upgraded)
5) moved old PHP files into /var/www/zabbix_1.5.3 and copied new PHP files into /var/www/zabbix
6) copied new config files into /etc/zabbix/ and reconfigured
7) /etc/init.d/zabbix-server start
Everything is OK and DB is updated to version 1.6.1
bye
Comment
Comment