Ad Widget

Collapse

Database error after upgrade from 3.4 to 4.2

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • igordashaar@gmx.de
    Junior Member
    • Mar 2018
    • 7

    #1

    Database error after upgrade from 3.4 to 4.2

    Hey,

    today i tried to upgrade zabbix server from 3.4 to 4.2 following these instructions:


    but now I am getting this error inside the web frontend:

    Click image for larger version

Name:	2019-07-14 16_13_16-Warning [refreshed every 30 sec.].png
Views:	4345
Size:	7.9 KB
ID:	382281
    or as text:


    Database error
    The frontend does not match Zabbix database. Current database version (mandatory/optional): 4020000/4020000. Required mandatory version: 3040000. Contact your system administrator.
    I am running Ubuntu 16.04.

    Installed frontend version matches the server version:
    Code:
    $ sudo apt install --only-upgrade zabbix-server-mysql zabbix-frontend-php zabbix-agent
    Paketlisten werden gelesen... Fertig
    Abhängigkeitsbaum wird aufgebaut.
    Statusinformationen werden eingelesen.... Fertig
    »zabbix-agent« ist bereits die neuste Version (1:4.2.4-1+xenial).
    »zabbix-frontend-php« ist bereits die neuste Version (1:4.2.4-1+xenial).
    »zabbix-server-mysql« ist bereits die neuste Version (1:4.2.4-1+xenial).
    I already tried restarting the services as well as a complete system reboot. But that did not help. Do you have any suggestions?

    Thanks in advance
    Attached Files
  • Manishk
    Junior Member
    • Apr 2019
    • 12

    #2
    Dear [email protected]
    you need to drop the existing database and create the new database.
    If you create MySQL database then Character set utf8 and utf8_bin collation is required for Zabbix server to work properly.
    please follow the below steps to create database:

    shell> mysql -u<username> -p<password>
    mysql> create database zabbix character set utf8 collate utf8_bin;
    mysql> quit;
    shell> mysql -u<username> -p<password> zabbix < database/mysql/schema.sql # stop here if you are creating database for Zabbix proxy
    shell> mysql -u<username> -p<password> zabbix < database/mysql/images.sql
    shell> mysql -u<username> -p<password> zabbix < database/mysql/data.sql

    After creation of database restart your zabbix server service and check the web frontend. Please do let me know, if your query is not get resolved. Thanks
    Last edited by Manishk; 15-07-2019, 10:48.

    Comment

    • igordashaar@gmx.de
      Junior Member
      • Mar 2018
      • 7

      #3
      Today I tried with dropping the database and creating a new one. Still the same result. I tried both 4.2 and 4.0.
      I do not quite understand why the error message states that i need an older version of the database. Thanks for your help!

      Comment

      • zux
        Member
        • Sep 2018
        • 93

        #4
        wow wow, no need to drop the DB, the upgrade was already done. The only problem here is that the frontend version doesn't match the server version. Did you move web files to a new location? It seems, that even if you updated the package, the web server still servers the old version.

        Comment

        • igordashaar@gmx.de
          Junior Member
          • Mar 2018
          • 7

          #5
          -.-
          Had to copy the files from /usr/share/zabbix to my actual webserver location in /var/www/zabbix.
          I guess thats some kind of newby mistake. But I wonder why this is never mentioned in the update manuals. Does anybody really run zabbix from /usr/share directory? Or is it common to use symlinks here?

          Comment


          • Atsushi
            Atsushi commented
            Editing a comment
            If you have a Zabbix standard package, you don't need to copy PHP files. It is functioning normally when placed under the /usr/share/zabbix directory. No symbolic link is required.
            The file must be copied because the web server is configured to require such settings. Check the existing settings of the web server and adjust the settings of the web server so that it can coexist with it.
        • zux
          Member
          • Sep 2018
          • 93

          #6
          Actually, the package creates a sudirectory xx.xx.xx.xx/zabbix that's normally the default link to access zabbix. And it serves the web files from /usr/share, but it looks like in your case somebody just copied them to /var/www/zabbix

          Comment

          • igordashaar@gmx.de
            Junior Member
            • Mar 2018
            • 7

            #7
            I guess that 'someone' in this case was me. Following these instructions:
            https://www.zabbix.com/documentation...lling_frontend

            I ran:

            It is suggested to use a subdirectory instead of the HTML root. To create a subdirectory and copy Zabbix frontend files into it, execute the following commands, replacing the actual directory:
            Code:
            mkdir <htdocs>/zabbix
            cd frontends/php
            cp -a . <htdocs>/zabbix
            Last edited by [email protected]; 16-08-2019, 16:54.

            Comment

            Working...