Ad Widget

Collapse

Database error. Required version 7000000

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jonathanbueno
    Junior Member
    • Oct 2024
    • 2

    #1

    Database error. Required version 7000000


    Hello everyone ! Greetings folks,

    I'll try to resume it for you to make it easier, let me know if you need some other information please

    I'm running Zabbix 6.4 on centOS, three separated servers: Zabbix Frontend 6.4, Zabbix Server 6.4 and MariaDB Database, all running good.

    My idea here now is to create a Kubernetes environment, install zabbix 7 and then migrate database from 6.4 server to this new one. I tried to do it, but didn't work. Zabbix 7 was running fine

    I created a dump from old 6.4 zabbix maria db database, which have 21gigs.

    // Command to make dump file
    mysqldump -u root -p --databases zabbix > zabbix.sql

    // Command to restore dumpfile into fresh new zabbix database on new mariadb database container
    nohup mariadb -u root -p'rootpass' zabbix < /tmp/zabbix.sql &

    I selected into database to see how many hosts, itens and so on, everything seems to be fine but when I ran "SELECT * FROM dbversion;" it returned "6040000" for both mandatory and optional colums (on new server)

    After all of that I deployed zabbix server and then frontend containers but now i'm receiving this error:

    "Database error
    • The Zabbix database version does not match current requirements. Your database version: 6040000. Required version: 7000000. Please contact your system administrator.

    "

    I was researching on chatgpt and it recommended me to run a script called upgrade_6-4_7-0.sql that I couldn't find anywhere.

    Folks, let me know if I can post here more detailed information, please.







  • jonathanbueno
    Junior Member
    • Oct 2024
    • 2

    #2
    Searching on some forums I could see that some people is setting "AllowUnsupportedDBVersions" to 1. But my question is, won't it break my zabbix application ? Will it update database fields that is missing for the new zabbix version ? ( just a guess ).

    Sorry if there are some english mistakes :v

    Thanks in advance !

    Comment

    • tim.mooney
      Senior Member
      • Dec 2012
      • 1427

      #3
      Originally posted by jonathanbueno
      mysqldump -u root -p --databases zabbix > zabbix.sql
      nohup mariadb -u root -p'rootpass' zabbix < /tmp/zabbix.sql &

      I selected into database to see how many hosts, itens and so on, everything seems to be fine but when I ran "SELECT * FROM dbversion;" it returned "6040000" for both mandatory and optional colums (on new server)
      As long as the version of MariaDB that you're using on your new install is on the list of supported versions, https://www.zabbix.com/documentation...n/requirements , then there's absolutely no reason to set AllowUnsupportedDBVersions.

      I'm not sure why you used "nohup" and "&" to load the dump of your 6.4 database in the background, but it shouldn't do any harm as long as you waited for it to finish.

      Your new zabbix_serverd 7.0.x was shut down while you were replacing the database with your 6.4.x dump, correct?

      What should happen is that the next time zabbix_serverd 7.0.x is restarted and it connects to your 'zabbix' database, it will notice that it's connecting to a 6.4.x database and the first thing it will do is start issuing SQL commands to alter tables, views, indexes etc. zabbix_serverd 7.0.x is responsible for transforming your existing 6.4.x database into a 7.0.x database. Assuming all the SQL it issues completes successfully, the last step it will do is update the values in the dbversion table, to reflect that it is done with its changes and you now have a 7.0.x zabbix database.

      As discussed in the Upgrade Notes, for MySQL and MariaDB, you need to set a special parameter before you let zabbix_serverd attempt this upgrade, otherwise it might fail. See the "log_bin_trust_function_creators" bit in the Upgrade Notes: https://www.zabbix.com/documentation...rade_notes_700

      When things work as intended, zabbix_serverd is responsible for doing most of the work to upgrade your database to match the server version. You have to be very careful when using any AI tools like ChatGPT, because those tools have a tendency to make up things that aren't real (that's often being called "hallucination"). I think ChatGPT may have hallucinated that SQL file it's talking about. I don't think it exists.

      Is there anything in your zabbix_server.log file, after you restart your 7.0.x server?

      Comment

      Working...