I'm using Zabbix Server 1.8.11, trying to upgrade to 2.0.0rc2 without success.
It is a CentOS 6.2 install with mysql innodb database.
The error is:
-------------------------------------
[root@zabbix mysql]# ./upgrade zabbix -uzabbix -pxxxxxxxxxxxxxxxxxxx
WARNING: backup your database before performing upgrade
This is an UNSUPPORTED Zabbix upgrade script from 1.8 to 2.0 for MySQL
It does the following things:
1. Updates indexes that might require changes;
2. Patches the database from 1.8 schema to 2.0 schema;
3. Adds 'Disabled' and 'Debug' usergroup if any missing;
4. Checks for hosts not belonging to any group and adds them to one if any found.
Usage: pass required MySQL parameters to this script (like database, user, password etc).
Continue ? (y/n) y
Dropping indexes that might need re-creation...
... dropping of indexes took 0:00:00
Creating possibly missing indexes...
creating of indexes took 0:00:00
Patching the database
ERROR 1452 (23000) at line 27: Cannot add or update a child row: a foreign key constraint fails (`zabbix`.<result 2 when explaining filename '#sql-942_4a'>, CONSTRAINT `c_alerts_2` FOREIGN KEY (`eventid`) REFERENCES `events` (`eventid`) ON DELETE CASCADE)
Failed to patch Zabbix database. Restore from backup
-------------------------------------
I tried restoring from backup and just using `mysql zabbix -uzabbix -pxxxxxxxxxx < patch.sql`, twice.. but didn't worked.
I guess it has something like https://support.zabbix.com/browse/ZBX-4693
But still don't know how to fix it.. somebody here knows?
I have another Zabbix installations that would be updated to 2.0.0 too, but if that errors occur.. I will need to keep server 1.8.x..
It is a CentOS 6.2 install with mysql innodb database.
The error is:
-------------------------------------
[root@zabbix mysql]# ./upgrade zabbix -uzabbix -pxxxxxxxxxxxxxxxxxxx
WARNING: backup your database before performing upgrade
This is an UNSUPPORTED Zabbix upgrade script from 1.8 to 2.0 for MySQL
It does the following things:
1. Updates indexes that might require changes;
2. Patches the database from 1.8 schema to 2.0 schema;
3. Adds 'Disabled' and 'Debug' usergroup if any missing;
4. Checks for hosts not belonging to any group and adds them to one if any found.
Usage: pass required MySQL parameters to this script (like database, user, password etc).
Continue ? (y/n) y
Dropping indexes that might need re-creation...
... dropping of indexes took 0:00:00
Creating possibly missing indexes...
creating of indexes took 0:00:00
Patching the database
ERROR 1452 (23000) at line 27: Cannot add or update a child row: a foreign key constraint fails (`zabbix`.<result 2 when explaining filename '#sql-942_4a'>, CONSTRAINT `c_alerts_2` FOREIGN KEY (`eventid`) REFERENCES `events` (`eventid`) ON DELETE CASCADE)
Failed to patch Zabbix database. Restore from backup
-------------------------------------
I tried restoring from backup and just using `mysql zabbix -uzabbix -pxxxxxxxxxx < patch.sql`, twice.. but didn't worked.
I guess it has something like https://support.zabbix.com/browse/ZBX-4693
But still don't know how to fix it.. somebody here knows?
I have another Zabbix installations that would be updated to 2.0.0 too, but if that errors occur.. I will need to keep server 1.8.x..