Ad Widget

Collapse

Zabbix Database Import - 5.0 to 6.4

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • victoraugustorez
    Junior Member
    • Feb 2022
    • 10

    #1

    Zabbix Database Import - 5.0 to 6.4

    Hi everyone.

    I've tried to update my Zabbix 5.0 to 6.4 version.

    Scenario:

    1 - We had an old Centos 7 with Zabbix 5.0

    2 - I started up a new server Centos 9

    3 - Configured the new server with Zabbix Settings (6.4) to receive the Database from the Zabbix 5.0

    4 - I finished the database import: mysql -u root zabbix < /bkpzabbix/zabbix_backup.sql

    5 - The Zabbix Database Update automatic didn't occurr as expected

    6 - Received the log below:

    36305:20230801:085731.865 IPv6 support: YES
    36305:20230801:085731.865 TLS support: YES
    36305:20230801:085731.865 ******************************
    36305:20230801:085731.865 using configuration file: /etc/zabbix/zabbix_server.conf
    36305:20230801:085731.884 current database version (mandatory/optional): 05000000/05000005
    36305:20230801:085731.884 required mandatory version: 06040000
    36305:20230801:085731.884 mandatory patches were found
    36305:20230801:085731.886 [Z3005] query failed: [1054] Unknown column 'ha_failover_delay' in 'field list' [select unix_timestamp(),ha_failover_delay from config]
    36305:20230801:085731.886 cannot retrieve database time
    36305:20230801:085731.886 Zabbix Server stopped. Zabbix 6.4.4 (revision a749236b3d9).

    So, I created a COLUMN called "ha_failover_delay" in the TABLE CONFIG and then, tried to start the zabbix-server. didn't success:

    28447:20230808:095305.403 Starting Zabbix Server. Zabbix 6.4.4 (revision a749236b3d9).
    28447:20230808:095305.403 ****** Enabled features ******
    28447:20230808:095305.403 SNMP monitoring: YES
    28447:20230808:095305.403 IPMI monitoring: YES
    28447:20230808:095305.403 Web monitoring: YES
    28447:20230808:095305.403 VMware monitoring: YES
    28447:20230808:095305.403 SMTP authentication: YES
    28447:20230808:095305.403 ODBC: YES
    28447:20230808:095305.403 SSH support: YES
    28447:20230808:095305.403 IPv6 support: YES
    28447:20230808:095305.403 TLS support: YES
    28447:20230808:095305.403 ******************************
    28447:20230808:095305.403 using configuration file: /etc/zabbix/zabbix_server.conf
    28447:20230808:095305.418 current database version (mandatory/optional): 05000000/05000005
    28447:20230808:095305.418 required mandatory version: 06040000
    28447:20230808:095305.418 mandatory patches were found
    28447:20230808:095305.419 Got signal [signal:11(SIGSEGV),reason:1,refaddrnil)]. Crashing ...
    28447:20230808:095305.419 ====== Fatal information: ======
    28447:20230808:095305.419 Program counter: 0x560741e1fa7a
    28447:20230808:095305.419 === Registers: ===
    28447:20230808:095305.419 r8 = 1999999999999999 = 1844674407370955161 = 1844674407370955161
    28447:20230808:095305.419 r9 = 0 = 0 = 0
    28447:20230808:095305.419 r10 = 7fe21ff9eac0 = 140609175808704 = 140609175808704
    28447:20230808:095305.419 r11 = 7fe21ff9f3c0 = 140609175811008 = 140609175811008
    28447:20230808:095305.419 r12 = 4c4b45 = 5000005 = 5000005
    28447:20230808:095305.419 r13 = 2ab = 683 = 683
    28447:20230808:095305.419 r14 = 560742fdd510 = 94589188691216 = 94589188691216
    28447:20230808:095305.419 r15 = 64d248c1 = 1691502785 = 1691502785
    28447:20230808:095305.419 rdi = 0 = 0 = 0
    28447:20230808:095305.419 rsi = 7fff7a6e5cc0 = 140735247441088 = 140735247441088
    28447:20230808:095305.419 rbp = 0 = 0 = 0
    28447:20230808:095305.419 rbx = 560742ff6760 = 94589188794208 = 94589188794208
    28447:20230808:095305.419 rdx = 7fffffff = 2147483647 = 2147483647
    28447:20230808:095305.419 rax = 64d248c1 = 1691502785 = 1691502785
    28447:20230808:095305.419 rcx = 560742ff6782 = 94589188794242 = 94589188794242
    28447:20230808:095305.419 rsp = 7fff7a6e5c60 = 140735247440992 = 140735247440992
    28447:20230808:095305.419 rip = 560741e1fa7a = 94589170088570 = 94589170088570
    28447:20230808:095305.419 efl = 10206 = 66054 = 66054
    28447:20230808:095305.419 csgsfs = 2b000000000033 = 12103423998558259 = 12103423998558259
    28447:20230808:095305.419 err = 4 = 4 = 4
    28447:20230808:095305.419 trapno = e = 14 = 14
    28447:20230808:095305.419 oldmask = 0 = 0 = 0
    28447:20230808:095305.419 cr2 = 0 = 0 = 0
    28447:20230808:095305.419 === Backtrace: ===
    28447:20230808:095305.420 10: /usr/sbin/zabbix_server(zbx_backtrace+0x46) [0x560741e00766]
    28447:20230808:095305.420 9: /usr/sbin/zabbix_server(zbx_log_fatal_info+0x295) [0x560741e00ae5]
    28447:20230808:095305.420 8: /usr/sbin/zabbix_server(+0x2f2096) [0x560741e01096]
    28447:20230808:095305.420 7: /lib64/libc.so.6(+0x54df0) [0x7fe21fe54df0]
    28447:20230808:095305.420 6: /usr/sbin/zabbix_server(zbx_is_time_suffix+0xa) [0x560741e1fa7a]
    28447:20230808:095305.420 5: /usr/sbin/zabbix_server(DBcheck_version+0x794) [0x560741d7a464]
    28447:20230808:095305.420 4: /usr/sbin/zabbix_server(MAIN_ZABBIX_ENTRY+0x66a) [0x560741b9cb8a]
    28447:20230808:095305.420 3: /usr/sbin/zabbix_server(main+0x242) [0x560741b91f12]
    28447:20230808:095305.420 2: /lib64/libc.so.6(+0x3feb0) [0x7fe21fe3feb0]
    28447:20230808:095305.420 1: /lib64/libc.so.6(__libc_start_main+0x80) [0x7fe21fe3ff60]
    28447:20230808:095305.420 0: /usr/sbin/zabbix_server(_start+0x25) [0x560741b99215]
    28447:20230808:095305.420 === Memory map: ===
    28447:20230808:095305.420 560741b0f000-560741b8b000 r--p 00000000 fd:00 805316920 /usr/sbin/zabbix_server_mysql
    28447:20230808:095305.420 560741b8b000-560741e30000 r-xp 0007c000 fd:00 805316920 /usr/sbin/zabbix_server_mysql
    28447:20230808:095305.420 560741e30000-560741f24000 r--p 00321000 fd:00 805316920 /usr/sbin/zabbix_server_mysql
    28447:20230808:095305.420 560741f24000-560741f28000 r--p 00414000 fd:00 805316920 /usr/sbin/zabbix_server_mysql
    28447:20230808:095305.420 560741f28000-560741ff7000 rw-p 00418000 fd:00 805316920 /usr/sbin/zabbix_server_mysql
    28447:20230808:095305.420 560741ff7000-560742007000 rw-p 00000000 00:00 0
    28447:20230808:095305.420 560742fbc000-560742fdd000 rw-p 00000000 00:00 0 [heap]
    28447:20230808:095305.420 560742fdd000-560742ffe000 rw-p 00000000 00:00 0 [heap]
    28447:20230808:095305.420 7fe21e06e000-7fe21e46e000 rw-s 00000000 00:01 17498153 /SYSV00000000 (deleted)
    28447:20230808:095305.420 7fe21e46e000-7fe21e86e000 rw-s 00000000 00:01 17498152 /SYSV00000000 (deleted)
    28447:20230808:095305.420 7fe21e86e000-7fe21f86e000 rw-s 00000000 00:01 17498151 /SYSV00000000 (deleted)
    28447:20230808:095305.420 7fe21f86e000-7fe21f870000 r--p 00000000 fd:00 805308901 /usr/lib64/libffi.so.8.1.0
    28447:20230808:095305.420 7fe21f870000-7fe21f876000 r-xp 00002000 fd:00 805308901 /usr/lib64/libffi.so.8.1.0
    28447:20230808:095305.420 7fe21f876000-7fe21f877000 r--p 00008000 fd:00 805308901 /usr/lib64/libffi.so.8.1.0
    28447:20230808:095305.420 7fe21f877000-7fe21f878000 ---p 00009000 fd:00 805308901 /usr/lib64/libffi.so.8.1.0
    28447:20230808:095305.420 7fe21f878000-7fe21f879000 r--p 00009000 fd:00 805308901 /usr/lib64/libffi.so.8.1.0
    28447:20230808:095305.420 7fe21f879000-7fe21f87a000 rw-p 0000a000 fd:00 805308901 /usr/lib64/libffi.so.8.1.0
    28447:20230808:095305.420 7fe21f87a000-7fe21f87d000 r--p 00000000 fd:00 805306508 /usr/lib64/libgcc_s-11-20230605.so.1
    28447:20230808:095305.420 7fe21f87d000-7fe21f88f000 r-xp 00003000 fd:00 805306508 /usr/lib64/libgcc_s-11-20230605.so.1
    28447:20230808:095305.420 7fe21f88f000-7fe21f892000 r--p 00015000 fd:00 805306508 /usr/lib64/libgcc_s-11-20230605.so.1
    28447:20230808:095305.420 7fe21f892000-7fe21f893000 ---p 00018000 fd:00 805306508 /usr/lib64/libgcc_s-11-20230605.so.1
    28447:20230808:095305.420 7fe21f893000-7fe21f894000 r--p 00018000 fd:00 805306508 /usr/lib64/libgcc_s-11-20230605.so.1
    28447:20230808:095305.420 7fe21f894000-7fe21f895000 rw-p 00019000 fd:00 805306508 /usr/lib64/libgcc_s-11-20230605.so.1
    ​​
    Last edited by victoraugustorez; 08-08-2023, 15:56.
  • victoraugustorez
    Junior Member
    • Feb 2022
    • 10

    #2
    What can I do here? Thanks!

    Comment

    • Andrew Grekhov
      Member
      • Aug 2021
      • 45

      #3
      My way:
      zabbix 5.0 -> 5.2 ->5.4
      5.4 -> 6.0 (php7->php8) fix https://www.zabbix.com/documentation...b_primary_keys
      6.0 -> 6.4.5 this is my problem

      > 6.0 -> 6.4.5 this is my problem
      upd: disable all host from web. starting zabbix-server. enable hosts.
      Last edited by Andrew Grekhov; 09-08-2023, 12:03.

      Comment

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

        #4
        When you prepared new environment, did you import DB schema for 5.0 or for 6.4? You should create exact replica of your old DB in new env and then point your new server to it... it should succeed with upgrades after that.

        Comment

        • victoraugustorez
          Junior Member
          • Feb 2022
          • 10

          #5
          Hi cyber.

          What did you mean with DB schema?

          I created the new server probably with the New Schema DB (6.0) and not with the 5.0.

          Should I remove this actual database and then recreate the database with the 5.0 steps?

          Like:

          # zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
          Não é a toa que o Zabbix está sendo baixado mais de 4.000.000 vezes por ano. Baixe o Zabbix gratuitamente e experimente vocá mesmo!

          Comment

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

            #6
            yes... that was my idea... I upgraded my 4.4 to 6 same way... I prepared all the platform for new one (new version of linux and postgres/php/apache etc..), but I created DB based on old one. Then imported data from old platform to new platform. After first start of new server it found old DB, did all the upgrade tasks (whatever conversions it needs, whatever new tables and columns it adds etc) and then I had nice a new instance of 6.0 with all ma previous data present.

            Comment

            • victoraugustorez
              Junior Member
              • Feb 2022
              • 10

              #7
              Thats nice!!

              I'm already trying in that way.

              It will take around 2 days because my database has around 400GB's.

              I'll let you know if its going to work.

              Thanks a ton man!!

              Comment

              Working...