Ad Widget

Collapse

Upgrade 6.0 LTS -> 7.0 LTS on MariaDB/Galera

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • martinko
    Junior Member
    • Aug 2022
    • 4

    #1

    Upgrade 6.0 LTS -> 7.0 LTS on MariaDB/Galera

    Hello guys,
    I'm trying to upgarde one instance of Zabbix 6.0 lts running on Galera to Zabbix 7.0.. All VM's are running updated Debian 12.. I've got into problem with database upgrade, in particular with:

    15584:20241204:173653.921 current database version (mandatory/optional): 06010075/06010075
    15584:20241204:173653.921 required mandatory version: 07000000
    15584:20241204:173653.921 mandatory patches were found
    15584:20241204:173653.983 [Z3005] query failed: [1005] Can't create table `zabbix`.`items` (errno: 121 "Duplicate key on write or update") [alter table `items` add constraint c_items_1 foreign key (`hostid`) references `hosts` (`hostid`)]
    15584:20241204:173653.983 database upgrade failed on patch 06010076, exiting in 10 seconds
    15584:20241204:173703.984 Zabbix Server stopped. Zabbix 7.0.6 (revision c1d7a081969).

    => Any idea please _where_ can I find those particular patches for SQL? So I can in more detail go with changes and maybe help a little with manual altering of tables etc..

    Maybe I'll add current snippet of 'items' table:

    KEY `items_1` (`hostid`,`key_`(764)),
    ...
    CONSTRAINT `c_items_1` FOREIGN KEY (`hostid`) REFERENCES `hosts` (`hostid`),

    But I don't know what that patch want to do..

    Thanks..
    Last edited by martinko; 04-12-2024, 19:09.
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    There should not be any need to "alter manually" .. if errors arise, they should be reviewed and solved, upgrade procedures should run through cleanly...
    Just recently someone here complained about similar topic.. cannot upgrade, errors etc... turned ut, not all prerequisites were satisfied.. First thing in upgrade notes was overlooked...
    To complete a successful Zabbix server upgrade on MySQL/MariaDB, you may require to set GLOBAL log_bin_trust_function_creators = 1 in MySQL if binary logging is enabled, there are no superuser privileges and log_bin_trust_function_creators = 1 is not set in MySQL configuration file.
    but just to satisfy your interest.. you can find info on patches from source code... https://git.zabbix.com/projects/ZBX/...s/zbxdbupgrade
    patch 06010076​, should be defined in a file https://git.zabbix.com/projects/ZBX/...de_6010.c#1142

    Comment

    • martinko
      Junior Member
      • Aug 2022
      • 4

      #3
      Thank you for the link, I will consult in the future..

      In the mean-time I've managed to solve this, I simply deleted mentioned constrain and let it re-create with patch and after some time database was converted correctly and I'm running 7.0.6 LTS atm..

      Thanks..

      Comment

      Working...