Ad Widget

Collapse

Upgrade ubuntu server 16.04 to 18.04 (ideally 20) and get zabbix back up

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • maco1717
    Junior Member
    • Apr 2019
    • 21

    #1

    Upgrade ubuntu server 16.04 to 18.04 (ideally 20) and get zabbix back up

    Hi,

    I am trying to figure out a way of upgrading zabbix 3.4.7 to the latest version running on ubuntu 16.04

    I have spun up a test Ubuntu server, installed black Zabbix 3.4.x after reading the Zabbix upgrade documentation it requires to be one at least Ubuntu 18.04 so it advises to upgrade ubuntu first and then Zabbix.

    I am upgrading Ubuntu to 18.04 this process bring zabbix down, as far as I can tell is something to do with mysql.

    At this point, I have tried
    • Reintalling zabbix-server (3.4.7)
    • Upgrading zabbix-server to latest
      • Installing/upgrading mysql
    mysql seam to not want to start because it cannot find the socket. I have tried looking into the MySQL .cfg socket parameter and the value does not exist when trying to find it on the system.

    should I provision ubuntu 18.04 install Zabbix 3.4.7 there and restore the DB in to that?

    I would like to upgrade in place, what would the recommended method be to doing something like this?

    Thanks.
    \M
  • tim.mooney
    Senior Member
    • Dec 2012
    • 1427

    #2
    Originally posted by maco1717
    I am upgrading Ubuntu to 18.04 this process bring zabbix down, as far as I can tell is something to do with mysql.
    What error messages or information points at MySQL being the problem? If you can provide more information on what problem you're seeing with MySQL, it's possible someone here can provide a suggestion that can help you get that issue fixed.

    If you want to upgrade in place, then I think you probably need to do the upgrade in stages. The upgrade process for Ubuntu has a "main page" here: https://www.zabbix.com/documentation.../debian_ubuntu

    If you can test the process on a test server then I would probably try this:
    1. install your test server so it's as close to your current system as possible, including being Ubuntu 16.04 and having Zabbix 3.4.7. Make sure Zabbix and the web interface are running on your test server before proceeding to the next steps.
    2. upgrade Zabbix to the 4.0 LTS version, using the official packages. If you used the Zabbix release repo for Zabbix 3.4.x, you probably need to remove it and install the repo for Zabbix 4.0, before you can upgrade the packages to the 4.0.x release.
    3. test your 4.0 version to make sure that at least the Zabbix server starts and that the web interface works.
    4. Now that you have Zabbix 4.0.x, you can upgrade your Ubuntu system to 18.04 or 20.04. You might have to uninstall the Zabbix 4.0 packages and the Zabbix 4.0 release repo before you can do the upgrade -- I'm not sure, as I have much more experience with Red Hat & CentOS than I do with Ubuntu or Debian. I also don't tend to do OS upgrades (we re-provision, rather than upgrade in place). It's OK if you need to (temporarily) uninstall Zabbix 4.0 as part of the Ubuntu OS upgrade, as long as you keep the database and the config files, you can just add the packages back later, once you're on 18.04 or 20.04.
    5. Once you're done with the OS upgrade, get Zabbix 4.0 LTS working again, if you needed to uninstall it as part of the upgrade. Even if you didn't need to uninstall the Zabbix 4.0 packages, you will need to change the Zabbix repo to point to the repo for Ubuntu 18.04 or 20.04, instead of the older repo for 16.04.
    6. Only once you have Zabbix 4.0 LTS working on 18.04 or 20.04 do you upgrade it to the 5.0 LTS version. This will be similar to what you had to do in step 2: you probably need to replace the repo package for Zabbix 4.0 with the repo package for Zabbix 5.0, then do the package upgrades, as outlined in the documentation above.
    This requires a few steps, but it should allow you to upgrade your install. Once you've tested it on your test system, you just repeat the steps on your production system.

    There is another method to get to 5.0 that doesn't require as many steps, but it isn't an upgrade in place. In that case you would do something like this:
    1. shut down Zabbix on your existing system.
    2. Do a full SQL backup (mysqldump) of your existing Zabbix database. Make sure you have copied this SQL dump output, the zabbix_server.conf, and your web server config for Zabbix and the zabbix.conf.php to another system or backup media.
    3. reinstall your Zabbix server as Ubuntu 20.04.
    4. Make sure all the requirements for Zabbix 5.0 are installed, including MySQL.
    5. import your Zabbix database SQL dump into the new MySQL instance running on your reinstalled server.
    6. Do a fresh install of Zabbix 5.0 LTS from packages but don't start the Zabbix server yet
    7. re-customize /etc/zabbix/zabbix_server.conf with any changes needed, including database parameters, based on the older zabbix_server.conf that you saved in step 2.
    8. re-customize the web server configuration and the zabbix.conf.php with any changes needed, based on the web-related files you saved in step 2.
    9. although you've imported the Zabbix database from backup already, make sure that you re-created the appropriate 'zabbix' user within MySQL, with the password you want to use and given it the grants to your Zabbix database. This is documented in the DB setup in a new install.
    10. once you have your config file customizations in place, start up zabbix-serverd. It should connect to your database, noticed that the database is for 3.4.x, and automatically upgrade the database from 3.4.x to 5.0.

    Comment

    • maco1717
      Junior Member
      • Apr 2019
      • 21

      #3
      Thanks for you reply Tim,

      At the moment I have moved on to trying new things I am trying a version of your second scenario in essence.

      If I go back to the first scenario I will send the error messages.

      Thanks.
      \M
      Last edited by maco1717; 30-09-2020, 09:53.

      Comment

      • maco1717
        Junior Member
        • Apr 2019
        • 21

        #4
        Thank you Tim for your message I managed to restore a DB of the old version of Zabbix on the newer version of it and it upgraded the DB as you indicated.

        Comment

        Working...