Cacti / cacti

Cacti ™
http://www.cacti.net
GNU General Public License v2.0
1.62k stars 403 forks source link

DB Schema Upgrade issue 0.8.8f to 1.2.10 #3819

Closed jkw117 closed 3 years ago

jkw117 commented 3 years ago

Describe the bug

Upgrading from v0.8.8f (DB 1.2.10 (DB: 0.8.8f)) to v1.0.0 - database migrated from old server. Two SQL DB commands failing.

The following fails:

ALTER TABLE automation_devices ADD COLUMN id BIGINT unsigned auto_increment FIRST, ADD COLUMN network_id INT unsigned NOT NULL default '0' AFTER id, ADD COLUMN snmp_port int(10) unsigned NOT NULL DEFAULT '161' AFTER snmp_version, ADD COLUMN snmp_engine_id varchar(30) DEFAULT '' AFTER snmp_context, DROP PRIMARY KEY, ADD PRIMARY KEY(id), ADD UNIQUE INDEX ip(ip); ADD INDEX network_id(network_id), COMMENT='Table of Discovered Devices' | [Fail]

I question two things, one why is it trying to alter the table when further down it is creating the table (on the condition that it is failing), I did try and drop the table and refresh the page it still shows the alter table as failing. I check mysql and it has recreated the table.

At one point " UPDATE cdef SET system=1 WHERE name LIKE '_%' " which fails is used to update the cdef table. the word system seems to be a protected word in mysql-server 8.0.21-0ubuntu0.20.04.4 this being said when I run the command in mysql with system in apostrophe's it is able to run the command successfully.

To Reproduce

Steps to reproduce the behavior:

Output for cdef mysql commands:

mysql> UPDATE cdef SET 'system'='1' WHERE name LIKE '_%'; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''system'='1' WHERE name LIKE '_%'' at line 1 mysql> UPDATE cdef SET system=1 WHERE name LIKE '_%'; Query OK, 4 rows affected (0.01 sec) Rows matched: 4 Changed: 4 Warnings: 0

Desktop (please complete the following information)

  CREATE TABLE IF NOT EXISTS user_auth_group ( id int(10) unsigned NOT NULL auto_increment, name varchar(20) NOT NULL, description varchar(255) NOT NULL default '', graph_settings varchar(2) DEFAULT NULL, login_opts tinyint(1) NOT NULL DEFAULT '1', show_tree varchar(2) DEFAULT 'on', show_list varchar(2) DEFAULT 'on', show_preview varchar(2) NOT NULL DEFAULT 'on', policy_graphs tinyint(1) unsigned NOT NULL DEFAULT '1', policy_trees tinyint(1) unsigned NOT NULL DEFAULT '1', policy_hosts tinyint(1) unsigned NOT NULL DEFAULT '1', policy_graph_templates tinyint(1) unsigned NOT NULL DEFAULT '1', enabled char(2) NOT NULL DEFAULT 'on', PRIMARY KEY (id)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Table that Contains User Groups'; [Success]
  CREATE TABLE IF NOT EXISTS user_auth_group_perms ( group_id mediumint(8) unsigned NOT NULL DEFAULT '0', item_id mediumint(8) unsigned NOT NULL DEFAULT '0', type tinyint(2) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (group_id,item_id,type), KEY group_id (group_id,type)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Table that Contains User Group Permissions'; [Success]
  CREATE TABLE IF NOT EXISTS user_auth_group_realm ( group_id int(10) unsigned NOT NULL, realm_id int(10) unsigned NOT NULL, PRIMARY KEY (group_id, realm_id), KEY group_id (group_id), KEY realm_id (realm_id)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Table that Contains User Group Realm Permissions'; [Success]
  CREATE TABLE IF NOT EXISTS user_auth_group_members ( group_id int(10) unsigned NOT NULL, user_id int(10) unsigned NOT NULL, PRIMARY KEY (group_id, user_id), KEY group_id (group_id), KEY realm_id (user_id)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Table that Contains User Group Members'; [Success]
  CREATE TABLE IF NOT EXISTS settings_user_group ( group_id smallint(8) unsigned NOT NULL DEFAULT '0', name varchar(50) NOT NULL DEFAULT '', value varchar(2048) NOT NULL DEFAULT '', PRIMARY KEY (group_id,name)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Stores the Default User Group Graph Settings'; [Success]
  CREATE TABLE IF NOT EXISTS data_source_stats_daily ( local_data_id mediumint(8) unsigned NOT NULL, rrd_name varchar(19) NOT NULL, average DOUBLE DEFAULT NULL, peak DOUBLE DEFAULT NULL, PRIMARY KEY (local_data_id,rrd_name) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; [Success]
  CREATE TABLE IF NOT EXISTS data_source_stats_hourly ( local_data_id mediumint(8) unsigned NOT NULL, rrd_name varchar(19) NOT NULL, average DOUBLE DEFAULT NULL, peak DOUBLE DEFAULT NULL, PRIMARY KEY (local_data_id,rrd_name) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; [Success]
  CREATE TABLE IF NOT EXISTS data_source_stats_hourly_cache ( local_data_id mediumint(8) unsigned NOT NULL, rrd_name varchar(19) NOT NULL, time timestamp NOT NULL default '0000-00-00 00:00:00', value DOUBLE DEFAULT NULL, PRIMARY KEY (local_data_id,time,rrd_name), KEY time USING BTREE (time) ) ENGINE=MEMORY; [Success]
  CREATE TABLE IF NOT EXISTS data_source_stats_hourly_last ( local_data_id mediumint(8) unsigned NOT NULL, rrd_name varchar(19) NOT NULL, value DOUBLE DEFAULT NULL, calculated DOUBLE DEFAULT NULL, PRIMARY KEY (local_data_id,rrd_name) ) ENGINE=MEMORY; [Success]
  ALTER TABLE data_source_stats_hourly_last ADD calculated [Success]
  CREATE TABLE IF NOT EXISTS data_source_stats_monthly ( local_data_id mediumint(8) unsigned NOT NULL, rrd_name varchar(19) NOT NULL, average DOUBLE DEFAULT NULL, peak DOUBLE DEFAULT NULL, PRIMARY KEY (local_data_id,rrd_name) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; [Success]
  CREATE TABLE IF NOT EXISTS data_source_stats_weekly ( local_data_id mediumint(8) unsigned NOT NULL, rrd_name varchar(19) NOT NULL, average DOUBLE DEFAULT NULL, peak DOUBLE DEFAULT NULL, PRIMARY KEY (local_data_id,rrd_name) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; [Success]
  CREATE TABLE IF NOT EXISTS data_source_stats_yearly ( local_data_id mediumint(8) unsigned NOT NULL, rrd_name varchar(19) NOT NULL, average DOUBLE DEFAULT NULL, peak DOUBLE DEFAULT NULL, PRIMARY KEY (local_data_id,rrd_name) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; [Success]
  CREATE TABLE IF NOT EXISTS poller_output_boost ( local_data_id mediumint(8) unsigned NOT NULL default '0', rrd_name varchar(19) NOT NULL default '', time timestamp NOT NULL default '0000-00-00 00:00:00', output varchar(512) NOT NULL, PRIMARY KEY USING BTREE (local_data_id,rrd_name,time) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; [Success]
  CREATE TABLE IF NOT EXISTS poller_output_boost_processes ( sock_int_value bigint(20) unsigned NOT NULL auto_increment, status varchar(255) default NULL, PRIMARY KEY (sock_int_value)) ENGINE=MEMORY; [Success]
  CREATE TABLE IF NOT EXISTS user_domains ( domain_id int(10) unsigned NOT NULL auto_increment, domain_name varchar(20) NOT NULL, type int(10) UNSIGNED NOT NULL DEFAULT '0', enabled char(2) NOT NULL DEFAULT 'on', defdomain tinyint(3) NOT NULL DEFAULT '0', user_id int(10) unsigned NOT NULL default '0', PRIMARY KEY (domain_id)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Table to Hold Login Domains'; [Success]
  CREATE TABLE IF NOT EXISTS user_domains_ldap ( domain_id int(10) unsigned NOT NULL, server varchar(128) NOT NULL, port int(10) unsigned NOT NULL, port_ssl int(10) unsigned NOT NULL, proto_version tinyint(3) unsigned NOT NULL, encryption tinyint(3) unsigned NOT NULL, referrals tinyint(3) unsigned NOT NULL, mode tinyint(3) unsigned NOT NULL, dn varchar(128) NOT NULL, group_require char(2) NOT NULL, group_dn varchar(128) NOT NULL, group_attrib varchar(128) NOT NULL, group_member_type tinyint(3) unsigned NOT NULL, search_base varchar(128) NOT NULL, search_filter varchar(128) NOT NULL, specific_dn varchar(128) NOT NULL, specific_password varchar(128) NOT NULL, PRIMARY KEY (domain_id)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Table to Hold Login Domains for LDAP'; [Success]
  CREATE TABLE IF NOT EXISTS snmpagent_cache ( oid varchar(191) NOT NULL, name varchar(191) NOT NULL, mib varchar(191) NOT NULL, type varchar(255) NOT NULL DEFAULT '', otype varchar(255) NOT NULL DEFAULT '', kind varchar(255) NOT NULL DEFAULT '', max-access varchar(255) NOT NULL DEFAULT 'not-accessible', value varchar(255) NOT NULL DEFAULT '', description varchar(5000) NOT NULL DEFAULT '', PRIMARY KEY (oid), KEY name (name), KEY mib (mib)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='SNMP MIB CACHE'; [Success]
  CREATE TABLE IF NOT EXISTS snmpagent_mibs ( id int(8) NOT NULL AUTO_INCREMENT, name varchar(32) NOT NULL DEFAULT '', file varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (id)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Registered MIB files'; [Success]
  CREATE TABLE IF NOT EXISTS snmpagent_cache_notifications ( name varchar(191) NOT NULL, mib varchar(255) NOT NULL, attribute varchar(255) NOT NULL, sequence_id smallint(6) NOT NULL, KEY name (name)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Notifcations and related attributes'; [Success]
  CREATE TABLE IF NOT EXISTS snmpagent_cache_textual_conventions ( name varchar(191) NOT NULL, mib varchar(191) NOT NULL, type varchar(255) NOT NULL DEFAULT '', description varchar(5000) NOT NULL DEFAULT '', KEY name (name), KEY mib (mib)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Textual conventions'; [Success]
  CREATE TABLE IF NOT EXISTS snmpagent_managers ( id int(8) NOT NULL AUTO_INCREMENT, hostname varchar(100) NOT NULL, description varchar(255) NOT NULL, disabled char(2) DEFAULT NULL, max_log_size tinyint(1) NOT NULL, snmp_version varchar(255) NOT NULL, snmp_community varchar(255) NOT NULL, snmp_username varchar(255) NOT NULL, snmp_auth_password varchar(255) NOT NULL, snmp_auth_protocol varchar(255) NOT NULL, snmp_priv_password varchar(255) NOT NULL, snmp_priv_protocol varchar(255) NOT NULL, snmp_engine_id varchar(64) NOT NULL DEFAULT '', snmp_port varchar(255) NOT NULL, snmp_message_type tinyint(1) NOT NULL, notes text, PRIMARY KEY (id), KEY hostname (hostname)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='snmp notification receivers'; [Success]
  CREATE TABLE IF NOT EXISTS snmpagent_managers_notifications ( manager_id int(8) NOT NULL, notification varchar(190) NOT NULL, mib varchar(191) NOT NULL, KEY mib (mib), KEY manager_id (manager_id), KEY manager_id2 (manager_id,notification)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='snmp notifications to receivers'; [Success]
  CREATE TABLE IF NOT EXISTS snmpagent_notifications_log ( id int(12) NOT NULL AUTO_INCREMENT, time int(24) NOT NULL, severity tinyint(1) NOT NULL, manager_id int(8) NOT NULL, notification varchar(190) NOT NULL, mib varchar(191) NOT NULL, varbinds varchar(5000) NOT NULL, PRIMARY KEY (id), KEY time (time), KEY severity (severity), KEY manager_id (manager_id), KEY manager_id2 (manager_id,notification)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='logs snmp notifications to receivers'; [Success]
  CREATE TABLE IF NOT EXISTS data_source_purge_temp ( id integer UNSIGNED auto_increment, name_cache varchar(255) NOT NULL default '', local_data_id mediumint(8) unsigned NOT NULL default '0', name varchar(128) NOT NULL default '', size integer UNSIGNED NOT NULL default '0', last_mod TIMESTAMP NOT NULL default '0000-00-00 00:00:00', in_cacti tinyint NOT NULL default '0', data_template_id mediumint(8) unsigned NOT NULL default '0', PRIMARY KEY (id), UNIQUE KEY name (name), KEY local_data_id (local_data_id), KEY in_cacti (in_cacti), KEY data_template_id (data_template_id)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='RRD Cleaner File Repository'; [Success]
  CREATE TABLE IF NOT EXISTS data_source_purge_action ( id integer UNSIGNED auto_increment, name varchar(128) NOT NULL default '', local_data_id mediumint(8) unsigned NOT NULL default '0', action tinyint(2) NOT NULL default 0, PRIMARY KEY (id), UNIQUE KEY name (name)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='RRD Cleaner File Actions'; [Success]
  ALTER TABLE graph_tree ADD enabled [Success]
  ALTER TABLE graph_tree ADD locked [Success]
  ALTER TABLE graph_tree ADD locked_date [Success]
  ALTER TABLE graph_tree ADD last_modified [Success]
  ALTER TABLE graph_tree ADD user_id [Success]
  ALTER TABLE graph_tree ADD modified_by [Success]
  ALTER TABLE graph_tree_items ADD parent [Success]
  ALTER TABLE graph_tree_items ADD position [Success]
  ALTER TABLE graph_tree_items MODIFY COLUMN id BIGINT UNSIGNED NOT NULL auto_increment [Success]
  ALTER TABLE graph_tree_items ADD INDEX parent(parent) [Success]
  ALTER TABLE graph_tree_items ADD INDEX parent(parent) [Success]
  DROP TABLE user_auth_cache [Success]
  CREATE TABLE user_auth_cache ( id int(10) unsigned NOT NULL AUTO_INCREMENT, user_id int(10) unsigned NOT NULL DEFAULT '0', hostname varchar(64) NOT NULL DEFAULT '', last_update timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, token varchar(191) NOT NULL DEFAULT '', PRIMARY KEY (id), UNIQUE KEY tokenkey (token), KEY hostname (hostname), KEY user_id (user_id)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Caches Remember Me Details' [Success]
  ALTER TABLE host MODIFY COLUMN status_fail_date timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', MODIFY COLUMN status_rec_date timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' [Success]
  ALTER TABLE poller MODIFY COLUMN last_update timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' [Success]
  ALTER TABLE poller_command MODIFY COLUMN time timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' [Success]
  ALTER TABLE poller_output MODIFY COLUMN time timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' [Success]
  ALTER TABLE poller_time MODIFY COLUMN start_time timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', MODIFY COLUMN end_time timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' [Success]
  ALTER TABLE user_log MODIFY COLUMN time timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' [Success]
  ALTER TABLE user_auth ADD lastchange [Success]
  ALTER TABLE user_auth ADD lastlogin [Success]
  ALTER TABLE user_auth ADD password_history [Success]
  ALTER TABLE user_auth ADD locked [Success]
  ALTER TABLE user_auth ADD failed_attempts [Success]
  ALTER TABLE user_auth ADD lastfail [Success]
  UPDATE graph_tree_items SET position=0 WHERE graph_tree_id=7 [Success]
  UPDATE graph_tree_items SET position=0 WHERE graph_tree_id=8 [Success]
  UPDATE graph_tree_items SET position=0 WHERE graph_tree_id=9 [Success]
  UPDATE graph_tree_items SET position=0 WHERE graph_tree_id=10 [Success]
  UPDATE graph_tree_items SET parent=0, position=0 WHERE id=285 [Success]
  UPDATE graph_tree_items SET parent=0, position=1 WHERE id=286 [Success]
  UPDATE graph_tree_items SET parent=0, position=2 WHERE id=287 [Success]
  UPDATE graph_tree_items SET parent=0, position=3 WHERE id=288 [Success]
  UPDATE graph_tree_items SET parent=0, position=4 WHERE id=289 [Success]
  UPDATE graph_tree_items SET parent=0, position=5 WHERE id=290 [Success]
  UPDATE graph_tree_items SET parent=0, position=6 WHERE id=291 [Success]
  UPDATE graph_tree_items SET position=0 WHERE graph_tree_id=11 [Success]
  UPDATE graph_tree_items SET parent=0, position=0 WHERE id=313 [Success]
  UPDATE graph_tree_items SET parent=0, position=1 WHERE id=314 [Success]
  UPDATE graph_tree_items SET parent=0, position=2 WHERE id=315 [Success]
  UPDATE graph_tree_items SET parent=0, position=3 WHERE id=316 [Success]
  UPDATE graph_tree_items SET parent=0, position=4 WHERE id=318 [Success]
  UPDATE graph_tree_items SET parent=0, position=5 WHERE id=319 [Success]
  UPDATE graph_tree_items SET parent=0, position=6 WHERE id=320 [Success]
  UPDATE graph_tree_items SET parent=0, position=7 WHERE id=321 [Success]
  UPDATE graph_tree_items SET parent=0, position=8 WHERE id=322 [Success]
  UPDATE graph_tree_items SET parent=0, position=9 WHERE id=323 [Success]
  UPDATE graph_tree_items SET parent=0, position=10 WHERE id=324 [Success]
  UPDATE graph_tree_items SET parent=0, position=11 WHERE id=325 [Success]
  UPDATE graph_tree_items SET parent=0, position=12 WHERE id=326 [Success]
  UPDATE graph_tree_items SET parent=0, position=13 WHERE id=327 [Success]
  UPDATE graph_tree_items SET parent=0, position=14 WHERE id=328 [Success]
  UPDATE graph_tree_items SET position=0 WHERE graph_tree_id=12 [Success]
  UPDATE graph_tree_items SET parent=0, position=0 WHERE id=293 [Success]
  UPDATE graph_tree_items SET parent=0, position=1 WHERE id=294 [Success]
  UPDATE graph_tree_items SET parent=0, position=2 WHERE id=295 [Success]
  UPDATE graph_tree_items SET parent=0, position=3 WHERE id=296 [Success]
  UPDATE graph_tree_items SET parent=0, position=4 WHERE id=297 [Success]
  UPDATE graph_tree_items SET parent=0, position=5 WHERE id=298 [Success]
  UPDATE graph_tree_items SET parent=0, position=6 WHERE id=299 [Success]
  UPDATE graph_tree_items SET parent=0, position=7 WHERE id=300 [Success]
  UPDATE graph_tree_items SET parent=0, position=8 WHERE id=301 [Success]
  UPDATE graph_tree_items SET parent=0, position=9 WHERE id=302 [Success]
  UPDATE graph_tree_items SET parent=0, position=10 WHERE id=304 [Success]
  UPDATE graph_tree_items SET parent=0, position=11 WHERE id=303 [Success]
  UPDATE graph_tree_items SET parent=0, position=12 WHERE id=305 [Success]
  UPDATE graph_tree_items SET parent=0, position=13 WHERE id=306 [Success]
  UPDATE graph_tree_items SET parent=0, position=14 WHERE id=307 [Success]
  UPDATE graph_tree_items SET parent=0, position=15 WHERE id=309 [Success]
  UPDATE graph_tree_items SET parent=0, position=16 WHERE id=308 [Success]
  UPDATE graph_tree_items SET parent=0, position=17 WHERE id=310 [Success]
  UPDATE graph_tree_items SET parent=0, position=18 WHERE id=311 [Success]
  UPDATE graph_tree_items SET parent=0, position=19 WHERE id=312 [Success]
  UPDATE graph_tree_items SET position=0 WHERE graph_tree_id=13 [Success]
  UPDATE graph_tree_items SET parent=329, position=1 WHERE id=338 [Success]
  UPDATE graph_tree_items SET parent=329, position=2 WHERE id=339 [Success]
  UPDATE graph_tree_items SET parent=329, position=3 WHERE id=340 [Success]
  UPDATE graph_tree_items SET parent=329, position=4 WHERE id=341 [Success]
  UPDATE graph_tree_items SET parent=329, position=5 WHERE id=342 [Success]
  UPDATE graph_tree_items SET parent=330, position=1 WHERE id=331 [Success]
  UPDATE graph_tree_items SET parent=330, position=2 WHERE id=332 [Success]
  UPDATE graph_tree_items SET parent=330, position=3 WHERE id=333 [Success]
  UPDATE graph_tree_items SET parent=330, position=4 WHERE id=334 [Success]
  UPDATE graph_tree_items SET parent=330, position=5 WHERE id=335 [Success]
  UPDATE graph_tree_items SET parent=330, position=6 WHERE id=336 [Success]
  UPDATE graph_tree_items SET parent=0, position=0 WHERE id=329 [Success]
  UPDATE graph_tree_items SET parent=0, position=1 WHERE id=330 [Success]
  ALTER TABLE graph_tree_items DROP order_key [Success]
  INSERT IGNORE INTO user_auth_realm VALUES (18,1) [Success]
  INSERT IGNORE INTO user_auth_realm VALUES (20,1) [Success]
  INSERT IGNORE INTO user_auth_realm VALUES (21,1) [Success]
  INSERT IGNORE INTO user_auth_realm VALUES (23,1) [Success]
  REPLACE INTO user_auth_realm VALUES (19,1); [Success]
  REPLACE INTO user_auth_realm VALUES (22,1); [Success]
  DELETE FROM plugin_config WHERE directory='aggregate' [Success]
  DELETE FROM plugin_realms WHERE plugin='aggregate' [Success]
  DELETE FROM plugin_db_changes WHERE plugin='aggregate' [Success]
  DELETE FROM plugin_hooks WHERE name='aggregate' [Success]
  DELETE FROM plugin_config WHERE directory='autom8' [Success]
  DELETE FROM plugin_realms WHERE plugin='autom8' [Success]
  DELETE FROM plugin_db_changes WHERE plugin='autom8' [Success]
  DELETE FROM plugin_hooks WHERE name='autom8' [Success]
  DELETE FROM plugin_config WHERE directory='clog' [Success]
  DELETE FROM plugin_realms WHERE plugin='clog' [Success]
  DELETE FROM plugin_db_changes WHERE plugin='clog' [Success]
  DELETE FROM plugin_hooks WHERE name='clog' [Success]
  DELETE FROM plugin_config WHERE directory='discovery' [Success]
  DELETE FROM plugin_realms WHERE plugin='discovery' [Success]
  DELETE FROM plugin_db_changes WHERE plugin='discovery' [Success]
  DELETE FROM plugin_hooks WHERE name='discovery' [Success]
  DELETE FROM plugin_config WHERE directory='domains' [Success]
  DELETE FROM plugin_realms WHERE plugin='domains' [Success]
  DELETE FROM plugin_db_changes WHERE plugin='domains' [Success]
  DELETE FROM plugin_hooks WHERE name='domains' [Success]
  DELETE FROM plugin_config WHERE directory='dsstats' [Success]
  DELETE FROM plugin_realms WHERE plugin='dsstats' [Success]
  DELETE FROM plugin_db_changes WHERE plugin='dsstats' [Success]
  DELETE FROM plugin_hooks WHERE name='dsstats' [Success]
  DELETE FROM plugin_config WHERE directory='nectar' [Success]
  DELETE FROM plugin_realms WHERE plugin='nectar' [Success]
  DELETE FROM plugin_db_changes WHERE plugin='nectar' [Success]
  DELETE FROM plugin_hooks WHERE name='nectar' [Success]
  DELETE FROM plugin_config WHERE directory='realtime' [Success]
  DELETE FROM plugin_realms WHERE plugin='realtime' [Success]
  DELETE FROM plugin_db_changes WHERE plugin='realtime' [Success]
  DELETE FROM plugin_hooks WHERE name='realtime' [Success]
  DELETE FROM plugin_config WHERE directory='rrdclean' [Success]
  DELETE FROM plugin_realms WHERE plugin='rrdclean' [Success]
  DELETE FROM plugin_db_changes WHERE plugin='rrdclean' [Success]
  DELETE FROM plugin_hooks WHERE name='rrdclean' [Success]
  DELETE FROM plugin_config WHERE directory='settings' [Success]
  DELETE FROM plugin_realms WHERE plugin='settings' [Success]
  DELETE FROM plugin_db_changes WHERE plugin='settings' [Success]
  DELETE FROM plugin_hooks WHERE name='settings' [Success]
  DELETE FROM plugin_config WHERE directory='snmpagent' [Success]
  DELETE FROM plugin_realms WHERE plugin='snmpagent' [Success]
  DELETE FROM plugin_db_changes WHERE plugin='snmpagent' [Success]
  DELETE FROM plugin_hooks WHERE name='snmpagent' [Success]
  DELETE FROM plugin_config WHERE directory='spikekill' [Success]
  DELETE FROM plugin_realms WHERE plugin='spikekill' [Success]
  DELETE FROM plugin_db_changes WHERE plugin='spikekill' [Success]
  DELETE FROM plugin_hooks WHERE name='spikekill' [Success]
  DELETE FROM plugin_config WHERE directory='superlinks' [Success]
  DELETE FROM plugin_realms WHERE plugin='superlinks' [Success]
  DELETE FROM plugin_db_changes WHERE plugin='superlinks' [Success]
  DELETE FROM plugin_hooks WHERE name='superlinks' [Success]
  DELETE FROM plugin_config WHERE directory='ugroup' [Success]
  DELETE FROM plugin_realms WHERE plugin='ugroup' [Success]
  DELETE FROM plugin_db_changes WHERE plugin='ugroup' [Success]
  DELETE FROM plugin_hooks WHERE name='ugroup' [Success]
  ALTER TABLE user_auth ADD email_address [Success]
  ALTER TABLE user_auth ADD password_change [Success]
  DROP TABLE poller_output_realtime [Success]
  CREATE TABLE poller_output_realtime ( local_data_id mediumint(8) unsigned NOT NULL default '0', rrd_name varchar(19) NOT NULL default '', time timestamp NOT NULL default '0000-00-00 00:00:00', output text NOT NULL, poller_id varchar(256) NOT NULL default '', PRIMARY KEY (local_data_id,rrd_name,time), KEY poller_id(poller_id(191))) ENGINE=InnoDB ROW_FORMAT=Dynamic [Success]
  DROP TABLE poller_output_rt [Success]
  CREATE TABLE IF NOT EXISTS reports ( id mediumint(8) unsigned NOT NULL AUTO_INCREMENT, user_id mediumint(8) unsigned NOT NULL DEFAULT '0', name varchar(100) NOT NULL DEFAULT '', cformat char(2) NOT NULL DEFAULT '', format_file varchar(255) NOT NULL DEFAULT '', font_size smallint(2) unsigned NOT NULL DEFAULT '0', alignment smallint(2) unsigned NOT NULL DEFAULT '0', graph_linked char(2) NOT NULL DEFAULT '', intrvl smallint(2) unsigned NOT NULL DEFAULT '0', count smallint(2) unsigned NOT NULL DEFAULT '0', offset int(12) unsigned NOT NULL DEFAULT '0', mailtime bigint(20) unsigned NOT NULL DEFAULT '0', subject varchar(64) NOT NULL DEFAULT '', from_name varchar(40) NOT NULL, from_email text NOT NULL, email text NOT NULL, bcc text NOT NULL, attachment_type smallint(2) unsigned NOT NULL DEFAULT '1', graph_height smallint(2) unsigned NOT NULL DEFAULT '0', graph_width smallint(2) unsigned NOT NULL DEFAULT '0', graph_columns smallint(2) unsigned NOT NULL DEFAULT '0', thumbnails char(2) NOT NULL DEFAULT '', lastsent bigint(20) unsigned NOT NULL DEFAULT '0', enabled char(2) DEFAULT '', PRIMARY KEY (id), KEY mailtime (mailtime)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Cacri Reporting Reports' [Success]
  CREATE TABLE IF NOT EXISTS reports_items ( id int(10) unsigned NOT NULL AUTO_INCREMENT, report_id int(10) unsigned NOT NULL DEFAULT '0', item_type tinyint(1) unsigned NOT NULL DEFAULT '1', tree_id int(10) unsigned NOT NULL DEFAULT '0', branch_id int(10) unsigned NOT NULL DEFAULT '0', tree_cascade char(2) NOT NULL DEFAULT '', graph_name_regexp varchar(128) NOT NULL DEFAULT '', host_template_id int(10) unsigned NOT NULL DEFAULT '0', host_id int(10) unsigned NOT NULL DEFAULT '0', graph_template_id int(10) unsigned NOT NULL DEFAULT '0', local_graph_id int(10) unsigned NOT NULL DEFAULT '0', timespan int(10) unsigned NOT NULL DEFAULT '0', align tinyint(1) unsigned NOT NULL DEFAULT '1', item_text text NOT NULL, font_size smallint(2) unsigned NOT NULL DEFAULT '10', sequence smallint(5) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (id), KEY report_id (report_id)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Cacti Reporting Items' [Success]
  ALTER TABLE host ADD snmp_sysDescr [Success]
  ALTER TABLE host ADD snmp_sysObjectID [Success]
  ALTER TABLE host ADD snmp_sysUpTimeInstance [Success]
  ALTER TABLE host ADD snmp_sysContact [Success]
  ALTER TABLE host ADD snmp_sysName [Success]
  ALTER TABLE host ADD snmp_sysLocation [Success]
  ALTER TABLE host ADD polling_time [Success]
  INSERT IGNORE INTO plugin_autom8_match_rule_items (id, rule_id, rule_type, sequence, operation, field, operator, pattern) VALUES (1, 1, 1, 1, 0, 'h.description', 14, ''), (2, 1, 1, 2, 1, 'h.snmp_version', 12, '2'), (3, 1, 3, 1, 0, 'ht.name', 1, 'Linux'), (4, 2, 1, 1, 0, 'ht.name', 1, 'Linux'), (5, 2, 1, 2, 1, 'h.snmp_version', 12, '2'), (6, 2, 3, 1, 0, 'ht.name', 1, 'SNMP'), (7, 2, 3, 2, 1, 'gt.name', 1, 'Traffic') [Success]
  INSERT IGNORE INTO plugin_autom8_graph_rules (id, name, snmp_query_id, graph_type_id, enabled) VALUES (1, 'Traffic 64 bit Server', 1, 14, ''), (2, 'Traffic 64 bit Server Linux', 1, 14, ''), (3, 'Disk Space', 8, 18, '') [Success]
  INSERT IGNORE INTO plugin_autom8_graph_rule_items (id, rule_id, sequence, operation, field, operator, pattern) VALUES (1, 1, 1, 0, 'ifOperStatus', 7, 'Up'), (2, 1, 2, 1, 'ifIP', 16, ''), (3, 1, 3, 1, 'ifHwAddr', 16, ''), (4, 2, 1, 0, 'ifOperStatus', 7, 'Up'), (5, 2, 2, 1, 'ifIP', 16, ''), (6, 2, 3, 1, 'ifHwAddr', 16, '') [Success]
  INSERT IGNORE INTO plugin_autom8_tree_rules (id, name, tree_id, tree_item_id, leaf_type, host_grouping_type, rra_id, enabled) VALUES (1, 'New Device', 1, 0, 3, 1, 0, ''), (2, 'New Graph', 1, 0, 2, 0, 1, '') [Success]
  INSERT INTO plugin_autom8_tree_rule_items (id, rule_id, sequence, field, rra_id, sort_type, propagate_changes, search_pattern, replace_pattern) VALUES (1, 1, 1, 'ht.name', 0, 1, '', '^(.)\sLinux\s(.)$', '${1}\n${2}'), (2, 1, 2, 'h.hostname', 0, 1, '', '^(\w)\s(\w)\s(\w).$', '${1}\n${2}\n${3}'), (3, 2, 1, '0', 0, 2, 'on', 'Traffic', ''), (4, 2, 2, 'gtg.title_cache', 0, 1, '', '^(.)\s-\sTraffic -\s(.*)$', '${1}\n${2}'); [Success]
  DROP TABLE IF EXISTS automation_graph_rules [Success]
  RENAME TABLE plugin_autom8_graph_rules TO automation_graph_rules [Success]
  DROP TABLE IF EXISTS automation_graph_rule_items [Success]
  RENAME TABLE plugin_autom8_graph_rule_items TO automation_graph_rule_items [Success]
  DROP TABLE IF EXISTS automation_match_rule_items [Success]
  RENAME TABLE plugin_autom8_match_rule_items TO automation_match_rule_items [Success]
  DROP TABLE IF EXISTS automation_tree_rules [Success]
  RENAME TABLE plugin_autom8_tree_rules TO automation_tree_rules [Success]
  DROP TABLE IF EXISTS automation_tree_rule_items [Success]
  RENAME TABLE plugin_autom8_tree_rule_items TO automation_tree_rule_items [Success]
  UPDATE IGNORE settings SET name = REPLACE(name, 'autom8', 'automation') WHERE name LIKE 'autom8%' [Success]
  RENAME TABLE plugin_discover_hosts TO automation_devices [Skipped]
  ALTER TABLE automation_devices DROP hash [Skipped]
  ALTER TABLE automation_devices ADD COLUMN id BIGINT unsigned auto_increment FIRST, ADD COLUMN network_id INT unsigned NOT NULL default '0' AFTER id, ADD COLUMN snmp_port int(10) unsigned NOT NULL DEFAULT '161' AFTER snmp_version, ADD COLUMN snmp_engine_id varchar(30) DEFAULT '' AFTER snmp_context, DROP PRIMARY KEY, ADD PRIMARY KEY(id), ADD UNIQUE INDEX ip(ip); ADD INDEX network_id(network_id), COMMENT='Table of Discovered Devices' [Fail]
  RENAME TABLE plugin_discover_template TO automation_templates [Skipped]
  ALTER TABLE automation_templates CHANGE COLUMN sysdescr sysDescr VARCHAR(255) DEFAULT '' [Success]
  ALTER TABLE automation_templates ADD availability_method [Success]
  ALTER TABLE automation_templates ADD sysName [Success]
  ALTER TABLE automation_templates ADD sysOid [Success]
  ALTER TABLE automation_templates ADD sequence [Success]
  ALTER TABLE automation_templates DROP tree [Skipped]
  ALTER TABLE automation_templates DROP snmp_version [Skipped]
  UPDATE automation_templates SET sequence=id [Success]
  CREATE TABLE IF NOT EXISTS automation_devices ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, network_id int(10) unsigned NOT NULL DEFAULT '0', hostname varchar(100) NOT NULL DEFAULT '', ip varchar(17) NOT NULL DEFAULT '', community varchar(100) NOT NULL DEFAULT '', snmp_version tinyint(1) unsigned NOT NULL DEFAULT '1', snmp_port int(10) unsigned NOT NULL DEFAULT '161', snmp_username varchar(50) DEFAULT NULL, snmp_password varchar(50) DEFAULT NULL, snmp_auth_protocol char(5) DEFAULT '', snmp_priv_passphrase varchar(200) DEFAULT '', snmp_priv_protocol char(6) DEFAULT '', snmp_context varchar(64) DEFAULT '', snmp_engine_id varchar(30) DEFAULT '', sysName varchar(100) NOT NULL DEFAULT '', sysLocation varchar(255) NOT NULL DEFAULT '', sysContact varchar(255) NOT NULL DEFAULT '', sysDescr varchar(255) NOT NULL DEFAULT '', sysUptime int(32) NOT NULL DEFAULT '0', os varchar(64) NOT NULL DEFAULT '', snmp tinyint(4) NOT NULL DEFAULT '0', known tinyint(4) NOT NULL DEFAULT '0', up tinyint(4) NOT NULL DEFAULT '0', time int(11) NOT NULL DEFAULT '0', PRIMARY KEY (id), UNIQUE KEY ip (ip), KEY hostname (hostname)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Table of Discovered Devices' [Success]
  CREATE TABLE IF NOT EXISTS automation_ips ( ip_address varchar(20) NOT NULL DEFAULT '', hostname varchar(250) DEFAULT NULL, network_id int(10) unsigned DEFAULT NULL, pid int(10) unsigned DEFAULT NULL, status int(10) unsigned DEFAULT NULL, thread int(10) unsigned DEFAULT NULL, PRIMARY KEY (ip_address), KEY pid (pid)) ENGINE=MEMORY COMMENT='List of discoverable ip addresses used for scanning' [Success]
  CREATE TABLE IF NOT EXISTS automation_networks ( id int(10) unsigned NOT NULL AUTO_INCREMENT, poller_id int(10) unsigned DEFAULT '0', name varchar(128) NOT NULL DEFAULT '' COMMENT 'The name for this network', subnet_range varchar(255) NOT NULL DEFAULT '' COMMENT 'Defined subnet ranges for discovery', dns_servers varchar(128) NOT NULL DEFAULT '' COMMENT 'DNS Servers to use for name resolution', enabled char(2) DEFAULT '', snmp_id int(10) unsigned DEFAULT NULL, enable_netbios char(2) DEFAULT '', add_to_cacti char(2) DEFAULT '', total_ips int(10) unsigned DEFAULT '0', up_hosts int(10) unsigned NOT NULL DEFAULT '0', snmp_hosts int(10) unsigned NOT NULL DEFAULT '0', ping_method int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'The ping method (ICMP:TCP:UDP)', ping_port int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'For TCP:UDP the port to ping', ping_timeout int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'The ping timeout in seconds', ping_retries int(10) unsigned DEFAULT '0', sched_type int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Schedule type: manual or automatic', threads int(10) unsigned DEFAULT '1', run_limit int(10) unsigned NULL DEFAULT '0' COMMENT 'The maximum runtime for the discovery', start_at varchar(20) DEFAULT NULL, next_start timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', recur_every int(10) unsigned DEFAULT '1', day_of_week varchar(45) DEFAULT NULL COMMENT 'The days of week to run in crontab format', month varchar(45) DEFAULT NULL COMMENT 'The months to run in crontab format', day_of_month varchar(45) DEFAULT NULL COMMENT 'The days of month to run in crontab format', monthly_week varchar(45) DEFAULT NULL, monthly_day varchar(45) DEFAULT NULL, last_runtime double NOT NULL DEFAULT '0' COMMENT 'The last runtime for discovery', last_started timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'The time the discovery last started', last_status varchar(128) NOT NULL DEFAULT '' COMMENT 'The last exit message if any', rerun_data_queries char(2) DEFAULT NULL COMMENT 'Rerun data queries or not for existing hosts', PRIMARY KEY (id), KEY poller_id (poller_id)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Stores scanning subnet definitions' [Success]
  CREATE TABLE IF NOT EXISTS automation_processes ( pid int(8) unsigned NOT NULL, poller_id int(10) unsigned DEFAULT '0', network_id int(10) unsigned NOT NULL DEFAULT '0', task varchar(20) NULL DEFAULT '', status varchar(20) DEFAULT NULL, command varchar(20) DEFAULT NULL, up_hosts int(10) unsigned DEFAULT '0', snmp_hosts int(10) unsigned DEFAULT '0', heartbeat timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (pid, network_id)) ENGINE=MEMORY COMMENT='Table tracking active poller processes' [Success]
  CREATE TABLE IF NOT EXISTS automation_snmp ( id int(10) unsigned NOT NULL AUTO_INCREMENT, name varchar(100) NOT NULL DEFAULT '', PRIMARY KEY (id)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Group of SNMP Option Sets' [Success]
  CREATE TABLE IF NOT EXISTS automation_snmp_items ( id int(10) unsigned NOT NULL AUTO_INCREMENT, snmp_id int(10) unsigned NOT NULL DEFAULT '0', sequence int(10) unsigned NOT NULL DEFAULT '0', snmp_version varchar(100) NOT NULL DEFAULT '', snmp_readstring varchar(100) NOT NULL, snmp_port int(10) NOT NULL DEFAULT '161', snmp_timeout int(10) unsigned NOT NULL DEFAULT '500', snmp_retries tinyint(11) unsigned NOT NULL DEFAULT '3', max_oids int(12) unsigned DEFAULT '10', snmp_username varchar(50) DEFAULT NULL, snmp_password varchar(50) DEFAULT NULL, snmp_auth_protocol char(5) DEFAULT '', snmp_priv_passphrase varchar(200) DEFAULT '', snmp_priv_protocol char(6) DEFAULT '', snmp_context varchar(64) DEFAULT '', PRIMARY KEY (id,snmp_id)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Set of SNMP Options' [Success]
  CREATE TABLE IF NOT EXISTS automation_templates ( id int(8) NOT NULL AUTO_INCREMENT, host_template int(8) NOT NULL DEFAULT '0', availability_method int(10) unsigned DEFAULT '2', sysDescr varchar(255) NULL DEFAULT '', sysName varchar(255) NULL DEFAULT '', sysOid varchar(60) NULL DEFAULT '', sequence int(10) unsigned DEFAULT '0', PRIMARY KEY (id)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Templates of SNMP Sys variables used for automation' [Success]
  UPDATE automation_match_rule_items SET field=REPLACE(field, 'host_template.', 'ht.') [Success]
  UPDATE automation_match_rule_items SET field=REPLACE(field, 'host.', 'h.') [Success]
  UPDATE automation_match_rule_items SET field=REPLACE(field, 'graph_templates.', 'gt.') [Success]
  UPDATE automation_match_rule_items SET field=REPLACE(field, 'graph_templates_graph.', 'gtg.') [Success]
  ALTER TABLE colors ADD UNIQUE INDEX hex(hex) [Success]
  ALTER TABLE colors ADD UNIQUE INDEX hex(hex) [Success]
  ALTER TABLE colors ADD name [Success]
  ALTER TABLE colors ADD read_only [Success]
  ALTER TABLE settings MODIFY COLUMN value varchar(2048) NOT NULL default '' [Success]
  ALTER TABLE settings_graphs MODIFY COLUMN value varchar(2048) NOT NULL default '' [Success]
  ALTER TABLE user_auth MODIFY COLUMN password varchar(2048) NOT NULL default '' [Success]
  RENAME TABLE settings_graphs TO settings_user [Skipped]
  ALTER TABLE user_auth ADD reset_perms [Success]
  ALTER TABLE graph_templates_item ADD vdef_id [Success]
  ALTER TABLE graph_templates_item ADD line_width [Success]
  ALTER TABLE graph_templates_item ADD dashes [Success]
  ALTER TABLE graph_templates_item ADD dash_offset [Success]
  ALTER TABLE graph_templates_item ADD shift [Success]
  ALTER TABLE graph_templates_item ADD textalign [Success]
  ALTER TABLE graph_templates_graph ADD t_alt_y_grid [Success]
  ALTER TABLE graph_templates_graph ADD alt_y_grid [Success]
  ALTER TABLE graph_templates_graph ADD t_right_axis [Success]
  ALTER TABLE graph_templates_graph ADD right_axis [Success]
  ALTER TABLE graph_templates_graph ADD t_right_axis_label [Success]
  ALTER TABLE graph_templates_graph ADD right_axis_label [Success]
  ALTER TABLE graph_templates_graph ADD t_right_axis_format [Success]
  ALTER TABLE graph_templates_graph ADD right_axis_format [Success]
  ALTER TABLE graph_templates_graph ADD t_right_axis_formatter [Success]
  ALTER TABLE graph_templates_graph ADD right_axis_formatter [Success]
  ALTER TABLE graph_templates_graph ADD t_left_axis_formatter [Success]
  ALTER TABLE graph_templates_graph ADD left_axis_formatter [Success]
  ALTER TABLE graph_templates_graph ADD t_no_gridfit [Success]
  ALTER TABLE graph_templates_graph ADD no_gridfit [Success]
  ALTER TABLE graph_templates_graph ADD t_unit_length [Success]
  ALTER TABLE graph_templates_graph ADD unit_length [Success]
  ALTER TABLE graph_templates_graph ADD t_tab_width [Success]
  ALTER TABLE graph_templates_graph ADD tab_width [Success]
  ALTER TABLE graph_templates_graph ADD t_dynamic_labels [Success]
  ALTER TABLE graph_templates_graph ADD dynamic_labels [Success]
  ALTER TABLE graph_templates_graph ADD t_force_rules_legend [Success]
  ALTER TABLE graph_templates_graph ADD force_rules_legend [Success]
  ALTER TABLE graph_templates_graph ADD t_legend_position [Success]
  ALTER TABLE graph_templates_graph ADD legend_position [Success]
  ALTER TABLE graph_templates_graph ADD t_legend_direction [Success]
  ALTER TABLE graph_templates_graph ADD legend_direction [Success]
  REPLACE INTO vdef VALUES (1, 'e06ed529238448773038601afb3cf278', 'Maximum'); [Success]
  REPLACE INTO vdef VALUES (2, 'e4872dda82092393d6459c831a50dc3b', 'Minimum'); [Success]
  REPLACE INTO vdef VALUES (3, '5ce1061a46bb62f36840c80412d2e629', 'Average'); [Success]
  REPLACE INTO vdef VALUES (4, '06bd3cbe802da6a0745ea5ba93af554a', 'Last (Current)'); [Success]
  REPLACE INTO vdef VALUES (5, '631c1b9086f3979d6dcf5c7a6946f104', 'First'); [Success]
  REPLACE INTO vdef VALUES (6, '6b5335843630b66f858ce6b7c61fc493', 'Total: Current Data Source'); [Success]
  REPLACE INTO vdef VALUES (7, 'c80d12b0f030af3574da68b28826cd39', '95th Percentage: Current Data Source'); [Success]
  REPLACE INTO vdef_items VALUES (1, '88d33bf9271ac2bdf490cf1784a342c1', 1, 1, 4, 'CURRENT_DATA_SOURCE'); [Success]
  REPLACE INTO vdef_items VALUES (2, 'a307afab0c9b1779580039e3f7c4f6e5', 1, 2, 1, '1'); [Success]
  REPLACE INTO vdef_items VALUES (3, '0945a96068bb57c80bfbd726cf1afa02', 2, 1, 4, 'CURRENT_DATA_SOURCE'); [Success]
  REPLACE INTO vdef_items VALUES (4, '95a8df2eac60a89e8a8ca3ea3d019c44', 2, 2, 1, '2'); [Success]
  REPLACE INTO vdef_items VALUES (5, 'cc2e1c47ec0b4f02eb13708cf6dac585', 3, 1, 4, 'CURRENT_DATA_SOURCE'); [Success]
  REPLACE INTO vdef_items VALUES (6, 'a2fd796335b87d9ba54af6a855689507', 3, 2, 1, '3'); [Success]
  REPLACE INTO vdef_items VALUES (7, 'a1d7974ee6018083a2053e0d0f7cb901', 4, 1, 4, 'CURRENT_DATA_SOURCE'); [Success]
  REPLACE INTO vdef_items VALUES (8, '26fccba1c215439616bc1b83637ae7f3', 4, 2, 1, '5'); [Success]
  REPLACE INTO vdef_items VALUES (9, 'a8993b265f4c5398f4a47c44b5b37a07', 5, 1, 4, 'CURRENT_DATA_SOURCE'); [Success]
  REPLACE INTO vdef_items VALUES (10, '5a380d469d611719057c3695ce1e4eee', 5, 2, 1, '6'); [Success]
  REPLACE INTO vdef_items VALUES (11, '65cfe546b17175fad41fcca98c057feb', 6, 1, 4, 'CURRENT_DATA_SOURCE'); [Success]
  REPLACE INTO vdef_items VALUES (12, 'f330b5633c3517d7c62762cef091cc9e', 6, 2, 1, '7'); [Success]
  REPLACE INTO vdef_items VALUES (13, 'f1bf2ecf54ca0565cf39c9c3f7e5394b', 7, 1, 4, 'CURRENT_DATA_SOURCE'); [Success]
  REPLACE INTO vdef_items VALUES (14, '11a26f18feba3919be3af426670cba95', 7, 2, 6, '95'); [Success]
  REPLACE INTO vdef_items VALUES (15, 'e7ae90275bc1efada07c19ca3472d9db', 7, 3, 1, '8'); [Success]
  ALTER TABLE data_template_data ADD t_data_source_profile_id [Success]
  ALTER TABLE data_template_data ADD data_source_profile_id [Success]
  CREATE TABLE IF NOT EXISTS data_source_profiles ( id mediumint(8) unsigned NOT NULL AUTO_INCREMENT, hash varchar(32) NOT NULL DEFAULT '', name varchar(255) NOT NULL DEFAULT '', step int(10) unsigned NOT NULL DEFAULT '300', heartbeat int(10) unsigned NOT NULL DEFAULT '600', x_files_factor double DEFAULT '0.5', default char(2) DEFAULT '', PRIMARY KEY (id)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Stores Data Source Profiles' [Success]
  CREATE TABLE IF NOT EXISTS data_source_profiles_cf ( data_source_profile_id mediumint(8) unsigned NOT NULL DEFAULT '0', consolidation_function_id smallint(5) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (data_source_profile_id,consolidation_function_id), KEY data_source_profile_id (data_source_profile_id)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Maps the Data Source Profile Consolidation Functions' [Success]
  CREATE TABLE IF NOT EXISTS data_source_profiles_rra ( id mediumint(8) unsigned NOT NULL AUTO_INCREMENT, data_source_profile_id mediumint(8) unsigned not null default '0', name varchar(255) NOT NULL DEFAULT '', steps int(10) unsigned DEFAULT '1', rows int(10) unsigned NOT NULL DEFAULT '700', PRIMARY KEY (id), KEY data_source_profile_id (data_source_profile_id)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Stores RRA Definitions for Data Source Profiles' [Success]
  INSERT INTO data_source_profiles_rra (data_source_profile_id, name, steps, rows) SELECT '4' AS data_source_profile_id, name, steps, rows FROM rra WHERE id=1 [Success]
  REPLACE INTO data_source_profiles_cf (data_source_profile_id, consolidation_function_id) SELECT '4' AS data_source_profile_id, consolidation_function_id FROM rra_cf WHERE rra_id=1 [Success]
  INSERT INTO data_source_profiles_rra (data_source_profile_id, name, steps, rows) SELECT '4' AS data_source_profile_id, name, steps, rows FROM rra WHERE id=2 [Success]
  REPLACE INTO data_source_profiles_cf (data_source_profile_id, consolidation_function_id) SELECT '4' AS data_source_profile_id, consolidation_function_id FROM rra_cf WHERE rra_id=2 [Success]
  INSERT INTO data_source_profiles_rra (data_source_profile_id, name, steps, rows) SELECT '4' AS data_source_profile_id, name, steps, rows FROM rra WHERE id=3 [Success]
  REPLACE INTO data_source_profiles_cf (data_source_profile_id, consolidation_function_id) SELECT '4' AS data_source_profile_id, consolidation_function_id FROM rra_cf WHERE rra_id=3 [Success]
  INSERT INTO data_source_profiles_rra (data_source_profile_id, name, steps, rows) SELECT '4' AS data_source_profile_id, name, steps, rows FROM rra WHERE id=4 [Success]
  REPLACE INTO data_source_profiles_cf (data_source_profile_id, consolidation_function_id) SELECT '4' AS data_source_profile_id, consolidation_function_id FROM rra_cf WHERE rra_id=4 [Success]
  UPDATE data_template_data SET data_source_profile_id=4 WHERE data_template_data.id IN( SELECT data_template_data_id FROM ( SELECT data_template_data_id, GROUP_CONCAT(rra_id) AS pattern FROM data_template_data_rra GROUP BY data_template_data_id HAVING pattern='1,2,3,4' ) AS rs); [Success]
  INSERT INTO data_source_profiles_rra (data_source_profile_id, name, steps, rows) SELECT '5' AS data_source_profile_id, name, steps, rows FROM rra WHERE id=1 [Success]
  REPLACE INTO data_source_profiles_cf (data_source_profile_id, consolidation_function_id) SELECT '5' AS data_source_profile_id, consolidation_function_id FROM rra_cf WHERE rra_id=1 [Success]
  INSERT INTO data_source_profiles_rra (data_source_profile_id, name, steps, rows) SELECT '5' AS data_source_profile_id, name, steps, rows FROM rra WHERE id=2 [Success]
  REPLACE INTO data_source_profiles_cf (data_source_profile_id, consolidation_function_id) SELECT '5' AS data_source_profile_id, consolidation_function_id FROM rra_cf WHERE rra_id=2 [Success]
  INSERT INTO data_source_profiles_rra (data_source_profile_id, name, steps, rows) SELECT '5' AS data_source_profile_id, name, steps, rows FROM rra WHERE id=3 [Success]
  REPLACE INTO data_source_profiles_cf (data_source_profile_id, consolidation_function_id) SELECT '5' AS data_source_profile_id, consolidation_function_id FROM rra_cf WHERE rra_id=3 [Success]
  INSERT INTO data_source_profiles_rra (data_source_profile_id, name, steps, rows) SELECT '5' AS data_source_profile_id, name, steps, rows FROM rra WHERE id=4 [Success]
  REPLACE INTO data_source_profiles_cf (data_source_profile_id, consolidation_function_id) SELECT '5' AS data_source_profile_id, consolidation_function_id FROM rra_cf WHERE rra_id=4 [Success]
  UPDATE data_template_data SET data_source_profile_id=5 WHERE data_template_data.id IN( SELECT data_template_data_id FROM ( SELECT data_template_data_id, GROUP_CONCAT(rra_id) AS pattern FROM data_template_data_rra GROUP BY data_template_data_id HAVING pattern='1,2,3,4' ) AS rs); [Success]
  INSERT INTO data_source_profiles_rra (data_source_profile_id, name, steps, rows) SELECT '6' AS data_source_profile_id, name, steps, rows FROM rra WHERE id=1 [Success]
  REPLACE INTO data_source_profiles_cf (data_source_profile_id, consolidation_function_id) SELECT '6' AS data_source_profile_id, consolidation_function_id FROM rra_cf WHERE rra_id=1 [Success]
  INSERT INTO data_source_profiles_rra (data_source_profile_id, name, steps, rows) SELECT '6' AS data_source_profile_id, name, steps, rows FROM rra WHERE id=2 [Success]
  REPLACE INTO data_source_profiles_cf (data_source_profile_id, consolidation_function_id) SELECT '6' AS data_source_profile_id, consolidation_function_id FROM rra_cf WHERE rra_id=2 [Success]
  INSERT INTO data_source_profiles_rra (data_source_profile_id, name, steps, rows) SELECT '6' AS data_source_profile_id, name, steps, rows FROM rra WHERE id=3 [Success]
  REPLACE INTO data_source_profiles_cf (data_source_profile_id, consolidation_function_id) SELECT '6' AS data_source_profile_id, consolidation_function_id FROM rra_cf WHERE rra_id=3 [Success]
  INSERT INTO data_source_profiles_rra (data_source_profile_id, name, steps, rows) SELECT '6' AS data_source_profile_id, name, steps, rows FROM rra WHERE id=4 [Success]
  REPLACE INTO data_source_profiles_cf (data_source_profile_id, consolidation_function_id) SELECT '6' AS data_source_profile_id, consolidation_function_id FROM rra_cf WHERE rra_id=4 [Success]
  INSERT INTO data_source_profiles_rra (data_source_profile_id, name, steps, rows) SELECT '6' AS data_source_profile_id, name, steps, rows FROM rra WHERE id=5 [Success]
  REPLACE INTO data_source_profiles_cf (data_source_profile_id, consolidation_function_id) SELECT '6' AS data_source_profile_id, consolidation_function_id FROM rra_cf WHERE rra_id=5 [Success]
  UPDATE data_template_data SET data_source_profile_id=6 WHERE data_template_data.id IN( SELECT data_template_data_id FROM ( SELECT data_template_data_id, GROUP_CONCAT(rra_id) AS pattern FROM data_template_data_rra GROUP BY data_template_data_id HAVING pattern='1,2,3,4,5' ) AS rs); [Success]
  DROP TABLE rra [Success]
  DROP TABLE rra_cf [Success]
  DROP TABLE data_template_data_rra [Success]
  ALTER TABLE data_template_data DROP t_rra_id [Success]
  ALTER TABLE automation_tree_rule_items DROP rra_id [Success]
  ALTER TABLE automation_tree_rules DROP rra_id [Success]
  ALTER TABLE graph_tree_items DROP rra_id [Success]
  ALTER TABLE aggregate_graph_templates_graph ADD t_alt_y_grid [Success]
  ALTER TABLE aggregate_graph_templates_graph ADD alt_y_grid [Success]
  ALTER TABLE aggregate_graph_templates_graph ADD t_right_axis [Success]
  ALTER TABLE aggregate_graph_templates_graph ADD right_axis [Success]
  ALTER TABLE aggregate_graph_templates_graph ADD t_right_axis_label [Success]
  ALTER TABLE aggregate_graph_templates_graph ADD right_axis_label [Success]
  ALTER TABLE aggregate_graph_templates_graph ADD t_right_axis_format [Success]
  ALTER TABLE aggregate_graph_templates_graph ADD right_axis_format [Success]
  ALTER TABLE aggregate_graph_templates_graph ADD t_right_axis_formatter [Success]
  ALTER TABLE aggregate_graph_templates_graph ADD right_axis_formatter [Success]
  ALTER TABLE aggregate_graph_templates_graph ADD t_left_axis_formatter [Success]
  ALTER TABLE aggregate_graph_templates_graph ADD left_axis_formatter [Success]
  ALTER TABLE aggregate_graph_templates_graph ADD t_no_gridfit [Success]
  ALTER TABLE aggregate_graph_templates_graph ADD no_gridfit [Success]
  ALTER TABLE aggregate_graph_templates_graph ADD t_unit_length [Success]
  ALTER TABLE aggregate_graph_templates_graph ADD unit_length [Success]
  ALTER TABLE aggregate_graph_templates_graph ADD t_tab_width [Success]
  ALTER TABLE aggregate_graph_templates_graph ADD tab_width [Success]
  ALTER TABLE aggregate_graph_templates_graph ADD t_dynamic_labels [Success]
  ALTER TABLE aggregate_graph_templates_graph ADD dynamic_labels [Success]
  ALTER TABLE aggregate_graph_templates_graph ADD t_force_rules_legend [Success]
  ALTER TABLE aggregate_graph_templates_graph ADD force_rules_legend [Success]
  ALTER TABLE aggregate_graph_templates_graph ADD t_legend_position [Success]
  ALTER TABLE aggregate_graph_templates_graph ADD legend_position [Success]
  ALTER TABLE aggregate_graph_templates_graph ADD t_legend_direction [Success]
  ALTER TABLE aggregate_graph_templates_graph ADD legend_direction [Success]
  ALTER TABLE cdef ADD system [Success]
  UPDATE cdef SET system=1 WHERE name LIKE '_%' [Fail]
  ALTER TABLE data_local ADD INDEX data_template_id(data_template_id) [Skipped]
  ALTER TABLE data_local ADD INDEX snmp_query_id(snmp_query_id) [Skipped]
  ALTER TABLE poller MODIFY COLUMN last_update TIMESTAMP NOT NULL default '0000-00-00' [Success]
  CREATE TABLE IF NOT EXISTS poller_resource_cache ( id int(10) unsigned NOT NULL AUTO_INCREMENT, resource_type varchar(20) DEFAULT NULL, md5sum varchar(32) DEFAULT NULL, path varchar(191) DEFAULT NULL, update_time timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', contents longblob, PRIMARY KEY (id), UNIQUE KEY path (path)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Caches all scripts, resources files, and plugins' [Success]
  ALTER TABLE host ADD poller_id [Success]
  ALTER TABLE host ADD INDEX poller_id(poller_id) [Success]
  ALTER TABLE host ADD INDEX poller_id(poller_id) [Success]
  CREATE TABLE IF NOT EXISTS external_links ( id int(11) NOT NULL AUTO_INCREMENT, sortorder int(11) NOT NULL DEFAULT '0', enabled char(2) DEFAULT 'on', contentfile varchar(255) NOT NULL DEFAULT '', title varchar(20) NOT NULL DEFAULT '', style varchar(10) NOT NULL DEFAULT '', extendedstyle varchar(50) NOT NULL DEFAULT '', PRIMARY KEY (id)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Stores External Link Information' [Success]
  CREATE TABLE IF NOT EXISTS sites ( id int(10) unsigned NOT NULL AUTO_INCREMENT, name varchar(100) NOT NULL DEFAULT '', address1 varchar(100) DEFAULT '', address2 varchar(100) DEFAULT '', city varchar(50) DEFAULT '', state varchar(20) DEFAULT NULL, postal_code varchar(20) DEFAULT '', country varchar(30) DEFAULT '', timezone varchar(40) DEFAULT '', latitude decimal(13,10) NOT NULL DEFAULT '0.0000000000', longitude decimal(13,10) NOT NULL DEFAULT '0.0000000000', alternate_id varchar(30) DEFAULT '', notes varchar(1024), PRIMARY KEY (id), KEY name (name), KEY city (city), KEY state (state), KEY postal_code (postal_code), KEY country (country), KEY alternate_id (alternate_id)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Contains information about customer sites'; [Success]
  ALTER TABLE host ADD site_id [Success]
  ALTER TABLE host MODIFY COLUMN poller_id mediumint(8) unsigned default '1' [Success]
  ALTER TABLE host ADD INDEX site_id(site_id) [Success]
  ALTER TABLE host ADD INDEX site_id(site_id) [Success]
  DROP TABLE poller [Success]
  CREATE TABLE poller ( id smallint(5) unsigned NOT NULL AUTO_INCREMENT, disabled char(2) DEFAULT '', name varchar(30) DEFAULT NULL, notes varchar(1024) DEFAULT '', status int(10) unsigned NOT NULL DEFAULT '0', hostname varchar(250) NOT NULL DEFAULT '', dbdefault varchar(20) NOT NULL DEFAULT 'cacti', dbhost varchar(64) NOT NULL DEFAULT '', dbuser varchar(20) NOT NULL DEFAULT '', dbpass varchar(64) NOT NULL DEFAULT '', dbport int(10) unsigned DEFAULT '3306', dbssl char(3) DEFAULT '', total_time double DEFAULT '0', snmp mediumint(8) unsigned DEFAULT '0', script mediumint(8) unsigned DEFAULT '0', server mediumint(8) unsigned DEFAULT '0', last_update timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', last_status timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (id)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Pollers for Cacti' [Success]
  INSERT INTO poller (id, name, hostname) VALUES (1, "Main Poller", "cacti") [Success]
  UPDATE automation_networks SET poller_id=1 WHERE poller_id=0 [Success]
  UPDATE automation_processes SET poller_id=1 WHERE poller_id=0 [Success]
  UPDATE host SET poller_id=1 WHERE poller_id=0 [Success]
  UPDATE poller_command SET poller_id=1 WHERE poller_id=0 [Success]
  UPDATE poller_item SET poller_id=1 WHERE poller_id=0 [Success]
  UPDATE poller_output_realtime SET poller_id=1 WHERE poller_id=0 [Success]
  UPDATE poller_time SET poller_id=1 WHERE poller_id=0 [Success]
  ALTER TABLE sessions MODIFY COLUMN data MEDIUMBLOB [Success]
  ALTER TABLE host ADD snmp_engine_id [Success]
  ALTER TABLE poller_item ADD snmp_engine_id [Success]
  ALTER TABLE automation_snmp_items ADD snmp_engine_id [Success]
  ALTER TABLE host MODIFY COLUMN poller_id int(10) unsigned DEFAULT "1" [Success]
  ALTER TABLE host MODIFY COLUMN site_id int(10) unsigned DEFAULT "1" [Success]
  ALTER TABLE host ADD last_updated [Success]
  ALTER TABLE host ADD INDEX last_updated(last_updated) [Success]
  ALTER TABLE host ADD INDEX last_updated(last_updated) [Success]
  ALTER TABLE host_snmp_cache ADD last_updated [Success]
  ALTER TABLE host_snmp_cache ADD INDEX last_updated(last_updated) [Success]
  ALTER TABLE host_snmp_cache ADD INDEX last_updated(last_updated) [Success]
  ALTER TABLE poller_item ADD last_updated [Success]
  ALTER TABLE poller_item ADD INDEX last_updated(last_updated) [Success]
  ALTER TABLE poller_item ADD INDEX last_updated(last_updated) [Success]
  ALTER TABLE poller_command ADD last_updated [Success]
  ALTER TABLE poller_command ADD INDEX last_updated(last_updated) [Success]
  ALTER TABLE poller_command ADD INDEX last_updated(last_updated) [Success]
  ALTER TABLE automation_networks MODIFY COLUMN poller_id int(10) unsigned DEFAULT "1" [Success]
  ALTER TABLE automation_processes MODIFY COLUMN poller_id int(10) unsigned DEFAULT "1" [Success]
  ALTER TABLE poller_command MODIFY COLUMN poller_id int(10) unsigned DEFAULT "1" [Success]
  ALTER TABLE poller_item MODIFY COLUMN poller_id int(10) unsigned DEFAULT "1" [Success]
  ALTER TABLE poller_time MODIFY COLUMN poller_id int(10) unsigned DEFAULT "1" [Success]
  ALTER TABLE graph_local ADD snmp_query_graph_id [Success]
  ALTER TABLE graph_local ADD INDEX snmp_query_graph_id(snmp_query_graph_id) [Success]
  ALTER TABLE graph_local ADD INDEX snmp_query_graph_id(snmp_query_graph_id) [Success]
  UPDATE graph_local AS gl INNER JOIN ( SELECT DISTINCT local_graph_id, task_item_id FROM graph_templates_item ) AS gti ON gl.id=gti.local_graph_id INNER JOIN data_template_rrd AS dtr ON gti.task_item_id=dtr.id INNER JOIN data_template_data AS dtd ON dtr.local_data_id=dtd.local_data_id INNER JOIN data_input_fields AS dif ON dif.data_input_id=dtd.data_input_id INNER JOIN data_input_data AS did ON did.data_template_data_id=dtd.id AND did.data_input_field_id=dif.id INNER JOIN snmp_query_graph_rrd AS sqgr ON sqgr.snmp_query_graph_id=did.value SET gl.snmp_query_graph_id=did.value WHERE input_output='in' AND type_code='output_type' AND gl.snmp_query_id>0 [Success]
  ALTER TABLE graph_tree ADD sequence [Success]
  UPDATE graph_tree SET sequence = ? WHERE id = ? [Success]
  UPDATE graph_tree SET sequence = ? WHERE id = ? [Success]
  UPDATE graph_tree SET sequence = ? WHERE id = ? [Success]
  UPDATE graph_tree SET sequence = ? WHERE id = ? [Success]
  UPDATE graph_tree SET sequence = ? WHERE id = ? [Success]
  UPDATE graph_tree SET sequence = ? WHERE id = ? [Success]
  UPDATE graph_tree SET sequence = ? WHERE id = ? [Success]
  CREATE TABLE IF NOT EXISTS poller_data_template_field_mappings ( data_template_id int(10) unsigned NOT NULL DEFAULT '0', data_name varchar(40) NOT NULL DEFAULT '', data_source_names varchar(125) NOT NULL DEFAULT '', last_updated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (data_template_id,data_name,data_source_names)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Tracks mapping of Data Templates to their Data Source Names' [Success]
  INSERT IGNORE INTO poller_data_template_field_mappings SELECT dtr.data_template_id, dif.data_name, GROUP_CONCAT(dtr.data_source_name ORDER BY dtr.data_source_name) AS data_source_names, NOW() FROM data_template_rrd AS dtr INNER JOIN data_input_fields AS dif ON dtr.data_input_field_id = dif.id WHERE dtr.local_data_id=0 GROUP BY dtr.data_template_id, dif.data_name [Success]
  ALTER TABLE host_snmp_cache MODIFY COLUMN field_value varchar(512) DEFAULT NULL [Success]
  UPDATE graph_templates_graph SET t_auto_scale_opts='' WHERE t_auto_scale_opts IS NULL [Success]
  UPDATE graph_templates_graph SET t_auto_scale_opts='' WHERE t_auto_scale_opts='0' [Success]
  UPDATE graph_templates_graph SET t_auto_scale_log='' WHERE t_auto_scale_log IS NULL [Success]
  UPDATE graph_templates_graph SET t_auto_scale_log='' WHERE t_auto_scale_log='0' [Success]
  UPDATE graph_templates_graph SET t_scale_log_units='' WHERE t_scale_log_units IS NULL [Success]
  UPDATE graph_templates_graph SET t_scale_log_units='' WHERE t_scale_log_units='0' [Success]
  UPDATE graph_templates_graph SET t_auto_scale_rigid='' WHERE t_auto_scale_rigid IS NULL [Success]
  UPDATE graph_templates_graph SET t_auto_scale_rigid='' WHERE t_auto_scale_rigid='0' [Success]
  UPDATE graph_templates_graph SET t_auto_padding='' WHERE t_auto_padding IS NULL [Success]
  UPDATE graph_templates_graph SET t_auto_padding='' WHERE t_auto_padding='0' [Success]
  UPDATE graph_templates_graph SET t_base_value='' WHERE t_base_value IS NULL [Success]
  UPDATE graph_templates_graph SET t_base_value='' WHERE t_base_value='0' [Success]
  UPDATE graph_templates_graph SET t_grouping='' WHERE t_grouping IS NULL [Success]
  UPDATE graph_templates_graph SET t_grouping='' WHERE t_grouping='0' [Success]
  UPDATE graph_templates_graph SET t_unit_value='' WHERE t_unit_value IS NULL [Success]
  UPDATE graph_templates_graph SET t_unit_value='' WHERE t_unit_value='0' [Success]
  UPDATE graph_templates_graph SET t_unit_exponent_value='' WHERE t_unit_exponent_value IS NULL [Success]
  UPDATE graph_templates_graph SET t_unit_exponent_value='' WHERE t_unit_exponent_value='0' [Success]
  UPDATE graph_templates_graph SET t_alt_y_grid='' WHERE t_alt_y_grid IS NULL [Success]
  UPDATE graph_templates_graph SET t_alt_y_grid='' WHERE t_alt_y_grid='0' [Success]
  UPDATE graph_templates_graph SET t_right_axis='' WHERE t_right_axis IS NULL [Success]
  UPDATE graph_templates_graph SET t_right_axis='' WHERE t_right_axis='0' [Success]
  UPDATE graph_templates_graph SET t_right_axis_label='' WHERE t_right_axis_label IS NULL [Success]
  UPDATE graph_templates_graph SET t_right_axis_label='' WHERE t_right_axis_label='0' [Success]
  UPDATE graph_templates_graph SET t_right_axis_format='' WHERE t_right_axis_format IS NULL [Success]
  UPDATE graph_templates_graph SET t_right_axis_format='' WHERE t_right_axis_format='0' [Success]
  UPDATE graph_templates_graph SET t_right_axis_formatter='' WHERE t_right_axis_formatter IS NULL [Success]
  UPDATE graph_templates_graph SET t_right_axis_formatter='' WHERE t_right_axis_formatter='0' [Success]
  UPDATE graph_templates_graph SET t_left_axis_formatter='' WHERE t_left_axis_formatter IS NULL [Success]
  UPDATE graph_templates_graph SET t_left_axis_formatter='' WHERE t_left_axis_formatter='0' [Success]
  UPDATE graph_templates_graph SET t_no_gridfit='' WHERE t_no_gridfit IS NULL [Success]
  UPDATE graph_templates_graph SET t_no_gridfit='' WHERE t_no_gridfit='0' [Success]
  UPDATE graph_templates_graph SET t_unit_length='' WHERE t_unit_length IS NULL [Success]
  UPDATE graph_templates_graph SET t_unit_length='' WHERE t_unit_length='0' [Success]
  UPDATE graph_templates_graph SET t_tab_width='' WHERE t_tab_width IS NULL [Success]
  UPDATE graph_templates_graph SET t_tab_width='' WHERE t_tab_width='0' [Success]
  UPDATE graph_templates_graph SET t_dynamic_labels='' WHERE t_dynamic_labels IS NULL [Success]
  UPDATE graph_templates_graph SET t_dynamic_labels='' WHERE t_dynamic_labels='0' [Success]
  UPDATE graph_templates_graph SET t_force_rules_legend='' WHERE t_force_rules_legend IS NULL [Success]
  UPDATE graph_templates_graph SET t_force_rules_legend='' WHERE t_force_rules_legend='0' [Success]
  UPDATE graph_templates_graph SET t_legend_position='' WHERE t_legend_position IS NULL [Success]
  UPDATE graph_templates_graph SET t_legend_position='' WHERE t_legend_position='0' [Success]
  UPDATE graph_templates_graph SET t_legend_direction='' WHERE t_legend_direction IS NULL [Success]
  UPDATE graph_templates_graph SET t_legend_direction='' WHERE t_legend_direction='0' [Success]
  UPDATE graph_templates_graph SET t_image_format_id='' WHERE t_image_format_id IS NULL [Success]
  UPDATE graph_templates_graph SET t_image_format_id='' WHERE t_image_format_id='0' [Success]
  UPDATE graph_templates_graph SET t_title='' WHERE t_title IS NULL [Success]
  UPDATE graph_templates_graph SET t_title='' WHERE t_title='0' [Success]
  UPDATE graph_templates_graph SET t_height='' WHERE t_height IS NULL [Success]
  UPDATE graph_templates_graph SET t_height='' WHERE t_height='0' [Success]
  UPDATE graph_templates_graph SET t_width='' WHERE t_width IS NULL [Success]
  UPDATE graph_templates_graph SET t_width='' WHERE t_width='0' [Success]
  UPDATE graph_templates_graph SET t_upper_limit='' WHERE t_upper_limit IS NULL [Success]
  UPDATE graph_templates_graph SET t_upper_limit='' WHERE t_upper_limit='0' [Success]
  UPDATE graph_templates_graph SET t_lower_limit='' WHERE t_lower_limit IS NULL [Success]
  UPDATE graph_templates_graph SET t_lower_limit='' WHERE t_lower_limit='0' [Success]
  UPDATE graph_templates_graph SET t_vertical_label='' WHERE t_vertical_label IS NULL [Success]
  UPDATE graph_templates_graph SET t_vertical_label='' WHERE t_vertical_label='0' [Success]
  UPDATE graph_templates_graph SET t_slope_mode='' WHERE t_slope_mode IS NULL [Success]
  UPDATE graph_templates_graph SET t_slope_mode='' WHERE t_slope_mode='0' [Success]
  UPDATE graph_templates_graph SET t_auto_scale='' WHERE t_auto_scale IS NULL [Success]
  UPDATE graph_templates_graph SET t_auto_scale='' WHERE t_auto_scale='0' [Success]
  UPDATE graph_templates_graph SET unit_value='' WHERE unit_value='on' [Success]
  ALTER TABLE data_local ADD INDEX snmp_index(snmp_index(191)) [Success]
  ALTER TABLE data_local ADD INDEX snmp_index(snmp_index(191)) [Success]
  ALTER TABLE graph_local DROP INDEX snmp_index [Success]
  ALTER TABLE graph_local DROP INDEX snmp_index [Success]
  ALTER TABLE graph_local ADD INDEX snmp_index(snmp_index(191)) [Success]
  ALTER TABLE graph_local ADD INDEX snmp_index(snmp_index(191)) [Success]
netniV commented 3 years ago

The system failing is a new one because it's become a protected word where in the past it was not. The reason we alter first is because they table may exist, in a later upgrade, we check if the table was even present because the automation sub system used to be a separate plugin so may not exist anyway and is done this way by design.

I am pretty sure that if you search through past issues, the 'system' keyword restriction has actually be raised already.

branchnetconsulting commented 3 years ago

I am running into this exact same issue with the failed altering of the cdef table when trying to upgrade from 0.8.8.f to 1.2.10 on Ubuntu 20.04. The mysql-server version installed by the standard Cacti 1.2.10 apt package for that distro is mysql-server-8.0.21-0ubuntu0.20.04.4, which is what was put on my system.

I dug through past issues and could find no reference to the 'system' keyword restriction.

Is there a recommended workaround for this? No matter what I try to enclose the reserved name 'system' in inside of a manual mysql session, I cannot get that cdef alter to work. I ended up manually insuring that the cdef table "system" fields are all changed from 0 to 1, by mysqldumping, hand-editing, and reimporting the cdef table.

However when I surf back to myserver.company.com/cacti I am forever redirected back to /cacti/install/install.php?data={"Step":98,"Eula":"1"} even in new incognito sessions.

Please advise what to try from here. Should I try to downgrade the Mysql-server running on my Ubuntu 20.04 server or pivot to Mariadb? Will I need to hold on for a fixed version of Cacti that avoids the now-reserved keyword of "system" as a field name?

Thanks, Kevin

jkw117 commented 3 years ago

I also did a manual upgrade to the latest released version of cacti 1.2.14 and still fails, but with less notes on what's wrong, it literally just takes me back to the license agreement page. (any suggestion on where I can turn up debugging/find the logs?) Also I've made the change in the mysql and it would still flag it as failed.. luckily I have a few snapshots in vmware so going back to the older version/undoing things isn't hard.

TheWitness commented 3 years ago

Grab the 'updates' folder from the 1.2.x branch. There was a recent change to the 1_0_0.php file for newer MariaDB's.

TheWitness commented 3 years ago
cd /var/www/html/cacti/install/updates/
branchnetconsulting commented 3 years ago

What worked for me based on TheWitness' advice:

fetch latest 1.2.x Cacti source from Git and then copy across the latest database migration scripts and supporting functons.php script that must accompany the new migration scripts to work.

cd /root git clone https://github.com/Cacti/cacti.git cd cacti git checkout 1.2.x cp /root/cacti/install/upgrades/1* /usr/share/cacti/site/install/upgrades/ cp /root/cacti/install/functions.php /usr/share/cacti/site/install/

blow away any db migration scripts newer than applicable to 1.2.10

rm /usr/share/cacti/site/install/upgrades/1_2_1?.php

import the old Cacti database

mysql cacti < cacti-0.8.8b.sql

initiate db migration from CLI where we can closely watch its progress

cd /usr/share/cacti php -q cli/upgrade_database.php

Upgrading from v0.8.8h Upgrading from v0.8.8h (DB 0.8.8h) to v1.0.0 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Upgrading from v1.0.0 (DB 1.0.0) to v1.0.4 -Upgrading from v1.0.4 (DB 1.0.4) to v1.0.5 ++++++++++++++++Upgrading from v1.0.5 (DB 1.0.5) to v1.1.2 ++++++++++++Upgrading from v1.1.2 (DB 1.1.2) to v1.1.4 ++++++++++-++--++--------++---++++++Upgrading from v1.1.4 (DB 1.1.4) to v1.1.6 ++++++++++-++-++++++++++-+++++Upgrading from v1.1.6 (DB 1.1.6) to v1.1.7 +Upgrading from v1.1.7 (DB 1.1.7) to v1.1.8 +Upgrading from v1.1.8 (DB 1.1.8) to v1.1.11 +++Upgrading from v1.1.11 (DB 1.1.11) to v1.1.14 +Upgrading from v1.1.14 (DB 1.1.14) to v1.1.17 +Upgrading from v1.1.17 (DB 1.1.17) to v1.1.20 ++++++++++++++++++Upgrading from v1.1.20 (DB 1.1.20) to v1.1.26 ++++++++-Upgrading from v1.1.26 (DB 1.1.26) to v1.1.28 ++++++-++Upgrading from v1.1.28 (DB 1.1.28) to v1.1.31 +++++Upgrading from v1.1.31 (DB 1.1.31) to v1.1.34 ++++-+++++++++++++++++++-+-++-+-++-+++-+++++++++-+-+++++-++-++Upgrading from v1.1.34 (DB 1.1.34) to v1.1.35 +++Upgrading from v1.1.35 (DB 1.1.35) to v1.1.36 ++Upgrading from v1.1.36 (DB 1.1.36) to v1.1.37 +Upgrading from v1.1.37 (DB 1.1.37) to v1.2.0 +++++++++++++++++++++++++++++++++++++++++++++Upgrading from v1.2.0 (DB 1.2.0) to v1.2.1 ++Upgrading from v1.2.1 (DB 1.2.1) to v1.2.2 ++Upgrading from v1.2.2 (DB 1.2.2) to v1.2.3 ++++Upgrading from v1.2.3 (DB 1.2.3) to v1.2.5 +++Upgrading from v1.2.5 (DB 1.2.5) to v1.2.7

Success! Thanks for the help! Kevin