Ad Widget

Collapse

Zabbix upgrade from 4.0.21 to 5.2 mysqlversion error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tleguizamon
    Junior Member
    • Feb 2021
    • 3

    #1

    Zabbix upgrade from 4.0.21 to 5.2 mysqlversion error

    Good morning Dear.

    I am having a problem updating my Zabbix server. Currently I have running the zabbix server version "zabbix_server (Zabbix) 4.0.21" with Ubuntu 16.04 xenial.

    I want to update it to zabbix server 5.2 with Ubuntu 20.04 focal.

    I installed in a new virtual server with Ubuntu 20.04 focla and I had no problems except for the version of the zabbix database, it has the following version:

    mysql> select * from dbversion;
    + ----------- + ---------- +
    | mandatory | optional |
    + ----------- + ---------- +
    | 4010004 | 4010004 |
    + ----------- + ---------- +
    1 row in set (0.00 sec)


    I would need to update at least to version 5020000, does anyone know how I can make this update?

    From already thank you very much.


    Greetings.
  • tim.mooney
    Senior Member
    • Dec 2012
    • 1427

    #2
    One of the first things the Zabbix server process does when it starts up is check the database. If the database schema version (as recorded in the dbversion table, as you've shown) isn't recent enough, the Zabbix server process attempts to upgrade the schema to the appropriate version.

    That means that the recommended way to upgrade the database is to install the version of the server you want (e.g. 5.2.3) and then start the zabbix-server process. Watch the zabbix_server.log (or zabbix_serverd.log) to view the database upgrade progress.

    Comment


    • tleguizamon
      tleguizamon commented
      Editing a comment
      Good morning.

      That is what I did, but when starting the zabbix-server process, I see the following error in / var / log / syslog:

      2476: 20210202: 184109.713 current database version (mandatory / optional): 04010004/04010004
      2476: 20210202: 184109.713 starting automatic database upgrade
      2476: 20210202: 184109.713 database upgrade failed

      It is for this reason that I want to know how to update the version of my database. Since when starting zabbix-server it cannot update it.

      From already thank you very much.

      Greetings.
  • tim.mooney
    Senior Member
    • Dec 2012
    • 1427

    #3
    There's no manual procedure to upgrade the database. If you were extremely determined, you could examine the source code for zabbix_server and find all of the SQL ALTER, CREATE, and DROP statements that it issues as part of the built-in update procedure, but if any of that fails when the server process is doing it, it will fail when you run it too.

    It seems like there's a problem possibly because of the move to the new system. Have you verified that the old server version runs and works with that database, before you try upgrade to the new server version?

    Comment


    • tleguizamon
      tleguizamon commented
      Editing a comment
      Tim.

      My current server (Ubuntu 16.04 with Zabbix 4.0.21) is working perfectly with that database.

      I just want to export that database so I don't lose all the settings as there are too many. To a new server with Ubuntu 20.04 and Zabbix 5.2.

      I think it is not something very crazy what I want to do, there should be some instructions from the official support.



      Greetings.
  • tim.mooney
    Senior Member
    • Dec 2012
    • 1427

    #4
    Hi tleguizamon!

    I understand what you're trying to do, and that your current config is working well. What you're trying to do makes good sense.

    Typically when someone is moving the database to a new system and installing a new version of Zabbix and there's a DB upgrade failure, it happens because they haven't fully or correctly configured the new Zabbix install for accessing the database.

    That doesn't really seem to be the case here, though, since the log message indicates that Zabbix 5.2 server is able to connect to the database to determine that it's still a 4.0.x DB. Typically it wouldn't even be able to do that if the problem were e.g. missing DB config in /etc/zabbix/zabbix_serverd.conf on the new system. You've presumably granted the database user (probably 'zabbix') the same permissions on the new install that you granted on the old, correct? I believe the install docs say 'ALL PRIVILEGES', so make certain the DB user on the new system has everything needed to be able to ALTER tables, DROP columns, etc.

    What backend database (MySQL, MariaDB, or Percona) and version are you using on the new system? When you imported your database dump from the old server into the new system, were there any warnings or messages in the database server log file?

    Comment


    • tleguizamon
      tleguizamon commented
      Editing a comment
      440 / 5000
      Resultados de traducción
      Tim,


      The database is Mysql on both servers. Version:

      mysql See 14.14 Distrib 5.7.33, for Linux (x86_64) using

      In the server in production there are no errors in the logs. On the other hand, when creating the database users, I assign the following privileges:

      grant all privileges on zabbix. * to zabbix @ localhost;

      I can't figure out how to update the database version to make it work on the new server.

      Greetings.
  • tleguizamon
    Junior Member
    • Feb 2021
    • 3

    #5
    Good morning friends.

    After several days I found the solution, so I share it with you.


    In order to upgrade the database, I upgraded my current production server (obviously with a snapshoot made previously) from version 4.0.21 with Ubuntu 16.04 to zabbix server 5.0.

    After that export the already updated database to 50000 and the files located in / etc / zabbix.


    Then on a new server with Ubuntu 20.04 install Zabbix server 5.0 (Exporting the database and the configuration files "/ etc / zabbix"). The next step was to upgrade to 5.2 (taking into account exporting the files located in / etc / zabbix) so that when starting the zabbix service, the database can be updated to 05000002.



    HTML Code:
     4079:20210210:174206.984 current database version (mandatory/optional): 05000000/05000002
    4079:20210210:174206.984 starting automatic database upgrade
    4079:20210210:174207.041 completed 1% of database upgrade
    4079:20210210:174207.233 completed 2% of database upgrade
    4079:20210210:174207.234 completed 4% of database upgrade
    4079:20210210:174207.236 completed 5% of database upgrade
    4079:20210210:174207.237 completed 7% of database upgrade
    4079:20210210:174207.301 completed 8% of database upgrade
    4079:20210210:174207.349 completed 10% of database upgrade
    4079:20210210:174207.386 completed 11% of database upgrade
    4079:20210210:174207.449 completed 13% of database upgrade
    4079:20210210:174207.470 completed 14% of database upgrade
    4079:20210210:174207.500 completed 15% of database upgrade
    4079:20210210:174207.530 completed 17% of database upgrade
    4079:20210210:174207.563 completed 18% of database upgrade
    4079:20210210:174207.591 completed 20% of database upgrade
    4079:20210210:174207.642 completed 21% of database upgrade
    4079:20210210:174207.663 completed 23% of database upgrade
    4079:20210210:174207.696 completed 24% of database upgrade
    4079:20210210:174207.716 completed 26% of database upgrade
    4079:20210210:174207.739 completed 27% of database upgrade
    4079:20210210:174207.768 completed 28% of database upgrade
    4079:20210210:174207.791 completed 30% of database upgrade
    4079:20210210:174207.820 completed 31% of database upgrade
    4079:20210210:174207.843 completed 33% of database upgrade
    4079:20210210:174207.866 completed 34% of database upgrade
    4079:20210210:174207.905 completed 36% of database upgrade
    4079:20210210:174207.913 completed 37% of database upgrade
    4079:20210210:174207.918 completed 39% of database upgrade
    4079:20210210:174207.926 completed 40% of database upgrade
    4079:20210210:174207.939 completed 42% of database upgrade
    4079:20210210:174207.999 completed 43% of database upgrade
    4079:20210210:174208.046 completed 44% of database upgrade
    4079:20210210:174208.094 completed 46% of database upgrade
    4079:20210210:174208.139 completed 47% of database upgrade
    4079:20210210:174208.300 completed 49% of database upgrade
    4079:20210210:174208.350 completed 50% of database upgrade
    4079:20210210:174208.358 completed 52% of database upgrade
    4079:20210210:174208.390 completed 53% of database upgrade
    4079:20210210:174208.399 completed 55% of database upgrade
    4079:20210210:174208.435 completed 56% of database upgrade
    4079:20210210:174208.463 completed 57% of database upgrade
    4079:20210210:174208.478 completed 59% of database upgrade
    4079:20210210:174208.499 completed 60% of database upgrade
    4079:20210210:174208.515 completed 62% of database upgrade
    4079:20210210:174208.602 completed 63% of database upgrade
    4079:20210210:174208.733 completed 65% of database upgrade
    4079:20210210:174208.757 completed 66% of database upgrade
    4079:20210210:174208.784 completed 68% of database upgrade
    4079:20210210:174208.802 completed 69% of database upgrade
    4079:20210210:174208.824 completed 71% of database upgrade
    4079:20210210:174208.838 completed 72% of database upgrade
    4079:20210210:174208.845 completed 73% of database upgrade
    4079:20210210:174208.876 completed 75% of database upgrade
    4079:20210210:174208.907 completed 76% of database upgrade
    4079:20210210:174208.919 completed 78% of database upgrade
    4079:20210210:174208.926 completed 79% of database upgrade
    4079:20210210:174208.933 completed 81% of database upgrade
    4079:20210210:174208.941 completed 82% of database upgrade
    4079:20210210:174208.949 completed 84% of database upgrade
    4079:20210210:174208.950 completed 85% of database upgrade
    4079:20210210:174208.953 completed 86% of database upgrade
    4079:20210210:174209.008 completed 88% of database upgrade
    4079:20210210:174209.009 completed 89% of database upgrade
    4079:20210210:174209.062 completed 91% of database upgrade
    4079:20210210:174209.115 completed 92% of database upgrade
    4079:20210210:174209.213 completed 94% of database upgrade
    4079:20210210:174209.232 completed 95% of database upgrade
    4079:20210210:174209.252 completed 97% of database upgrade
    4079:20210210:174209.255 completed 98% of database upgrade
    4079:20210210:174209.255 completed 100% of database upgrade
    4079:20210210:174209.255 database upgrade fully completed

    Comment

    Working...