Ad Widget

Collapse

Database upgrade error after migrating Zabbix from Centos 8 to Debian 12

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Pablok
    Junior Member
    • Apr 2023
    • 4

    #1

    Database upgrade error after migrating Zabbix from Centos 8 to Debian 12

    Hi, I just migrated Zabbix 7.4.3 running under Centos 8.0 to Debian 12 following this steps:
    1) Install new instance of Zabbix (7.4.3) under Debian 12 and starts whitout problems with blank dabatase.
    It's the same version that's running on Centos 8.0
    2) Backup database of Zabbix on Centos 8 and copy to new instance on Debian 12.
    Database running is MariaDB: "mysql Ver 15.1 Distrib 10.11.14-MariaDB"
    3) Restore database on Debian 12 without errors.
    4) Start Zabbix server on Debian 12 and receive this error message:
    "The Zabbix database version does not match current requirements. Your database version: 7030033. Required version: 7040000."
    5) This is log of zabbix server:

    10569:20251016:083829.823 database upgrade failed on patch 07030034, exiting in 10 seconds
    10569:20251016:083840.879 Zabbix Server stopped. Zabbix 7.4.3 (revision 9c308d6f49c).
    10654:20251016:083851.032 Starting Zabbix Server. Zabbix 7.4.3 (revision 9c308d6f49c).
    10654:20251016:083851.032 ****** Enabled features ******
    10654:20251016:083851.032 SNMP monitoring: YES
    10654:20251016:083851.032 IPMI monitoring: YES
    10654:20251016:083851.032 Web monitoring: YES
    10654:20251016:083851.032 VMware monitoring: YES
    10654:20251016:083851.032 SMTP authentication: YES
    10654:20251016:083851.032 ODBC: YES
    10654:20251016:083851.032 SSH support: YES
    10654:20251016:083851.032 IPv6 support: YES
    10654:20251016:083851.033 TLS support: YES
    10654:20251016:083851.033 ******************************
    10654:20251016:083851.033 using configuration file: /etc/zabbix/zabbix_server.conf
    10654:20251016:083851.051 current database version (mandatory/optional): 07030033/07030033
    10654:20251016:083851.051 required mandatory version: 07040000
    10654:20251016:083851.051 mandatory patches were found
    10654:20251016:083851.056 starting automatic database upgrade
    10654:20251016:083851.057 [Z3005] query failed: [1050] Table 'media_type_oauth' already exists [create table media_type_oauth (
    `mediatypeid` bigint unsigned not null,
    `redirection_url` varchar(2048) default '' not null,
    `client_id` varchar(255) default '' not null,
    `client_secret` varchar(255) default '' not null,
    `authorization_url` varchar(2048) default '' not null,
    `tokens_status` integer default '0' not null,
    `access_token` text not null,
    `access_token_updated` integer default '0' not null,
    `access_expires_in` integer default '0' not null,
    `refresh_token` text not null,
    `token_url` varchar(2048) default '' not null,
    primary key (mediatypeid)
    ) engine=innodb]
    10654:20251016:083851.057 database upgrade failed on patch 07030034, exiting in 10 seconds

    ​​
    I tried many times, and searching and applying all suggestions finds about similar issues, but still persists this problem.
    I really appreciate same help, thank you in advance...!!!​
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    "Your database version: 7030033. Required version: 7040000."
    Have you upgraded this instance from any previous version? Was it successful? Patches starting with 703 are the ones created after v7.2 came out.. Intermediate ones for upgrade and there should be more of those, I think last one is 7030048 (https://git.zabbix.com/projects/ZBX/...ade_7030.c#618)
    patch 7040000 is basically empty one, just to update version number of patches when 7.4.0 is installed ... https://git.zabbix.com/projects/ZBX/...upgrade_7040.c after that patches with 705 are added ...

    Comment

    • Pablok
      Junior Member
      • Apr 2023
      • 4

      #3
      Hi,
      "Have you upgraded this instance from any previous version? Was it successful?" Yes, I has upgraded starting from version 6 (many years ago...) without errors and its running fine until now (under Centos 8, of course)
      Install Zabbix under Debian 12 it's fine and running fine with clean database.
      Problem appears when restore database from Centos 8 to Debian 12, but restoring process finished without errors.

      Comment

      • cyber
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Dec 2006
        • 4807

        #4
        For me it looks like inconsistency here... your DB seems to contain things that upgrade process wants to install... And then it fails.
        Originally posted by Pablok
        Install Zabbix under Debian 12 it's fine and running fine with clean database.
        I would not install any DB schema before restoring old DB.. you can export your old db with all the "create table" clauses... it should end up with absolutely identical db.​

        Comment

        • Pablok
          Junior Member
          • Apr 2023
          • 4

          #5
          Hi, finally I got it...!!! Log message was clear: "Table 'media_type_oauth' already exists"
          All I has to do was deleted that table, and then another two tables that just exists; after this, import process completed without errors.
          Thank you very much for your assistance...!!!!

          Comment

          Working...