Ad Widget

Collapse

Upgrade question

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tuckson
    Junior Member
    • Apr 2024
    • 4

    #1

    Upgrade question

    Hi,

    Art this moment we are in the middle of bringing an ancient platform to more modern times. One of the servers that has it's tern now is our Zabbix server.
    This thing is running virtual (KVM) and is installed on Centos 8 stream. We are running version 4.4.10 with Mysql als DB.
    The target environment is RHEL 9.3 with Zabbix 6.4

    Of course I would like to preserve all dashboards and stuff inside zabbix, but I am new to this. (Never worked with Zabbix before) . I learned 4.4.10 does not run on RHEL 9. Moreover, it is not possible to copy data 1 on 1 to 6,4 since during the versions quite some changes have been made. So it feels a bit like the chicken and the egg discussion.
    What is the best way to go?

    THIA
  • Answer selected by Tuckson at 15-08-2024, 13:23.
    irontmp
    Member
    • Sep 2023
    • 36

    Originally posted by Tuckson
    Hi,

    Art this moment we are in the middle of bringing an ancient platform to more modern times. One of the servers that has it's tern now is our Zabbix server.
    This thing is running virtual (KVM) and is installed on Centos 8 stream. We are running version 4.4.10 with Mysql als DB.
    The target environment is RHEL 9.3 with Zabbix 6.4

    Of course I would like to preserve all dashboards and stuff inside zabbix, but I am new to this. (Never worked with Zabbix before) . I learned 4.4.10 does not run on RHEL 9. Moreover, it is not possible to copy data 1 on 1 to 6,4 since during the versions quite some changes have been made. So it feels a bit like the chicken and the egg discussion.
    What is the best way to go?

    THIA
    To upgrade your Zabbix server from 4.4.10 on CentOS 8 Stream to 6.4 on RHEL 9.3, follow these steps:
    1. Backup Current Environment:
      • Backup MySQL database:bash
        Copy code
        mysqldump -u [user] -p [database_name] > zabbix_backup.sql
      • Backup Zabbix configuration files from /etc/zabbix/.
    2. Set Up New Environment:
      • Install RHEL 9.3 and apply updates.
      • Install Zabbix 6.4 on RHEL 9.3 following official documentation.
      • Install MySQL or PostgreSQL on the new server.
    3. Upgrade Path:
      • Incrementally upgrade Zabbix:
        • 4.4.10 -> 5.0
        • 5.0 -> 5.4
        • 5.4 -> 6.0
        • 6.0 -> 6.4
    4. Perform Incremental Upgrades:
      • Install Zabbix 5.0 on a temporary server (CentOS 8 Stream).
      • Restore the database and upgrade to 5.0:bash
        Copy code
        rpm -Uvh zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix_server -c /etc/zabbix/zabbix_server.conf --upgrade
      • Repeat for 5.4 and 6.0.
    5. Migrate to RHEL 9.3:
      • Backup the upgraded 6.0 database.
      • Install Zabbix 6.4 on RHEL 9.3.
      • Restore the database:bash
        Copy code
        mysql -u [user] -p [database_name] < zabbix_backup.sql
      • Verify and adjust configurations as needed.
    6. Test and Finalize:
      • Ensure all dashboards and monitoring items are functional.
      • Decommission old servers and temporary upgrade servers.
      • Update documentation with new server details and changes.

    This process ensures a smooth upgrade while preserving your Zabbix data and configurations.

    Comment


    • Tuckson
      Tuckson commented
      Editing a comment
      Just a note that by following this process I succeeded in the upgrade. Thnx again. For others: Maybe a bit of a loner path, but it helps in reaching milestones underway.
      Also: Do not forget to upgrade your DB when upgrading to 6 (primairy keys) and when creating a new DB before importing the old DB, mind the character set setting.
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4806

    #2
    There is many topics on this, how to build side by side setups due to platform restrictions...
    You could do inplace upgrade, as centos8 should be able to run 6.4. And after that set up your RH9 and copy things (DB) over...
    you can also set up new rh9 environment with 6.4, copy over your 4.4 DB (do not create db with 6.4 scripts, but copy over the 4.4..) and then, if you start up your new instance, which should then find old db, do necessary upgrades and you should have new 6.4 instance with all the old data etc present...

    Comment

    • Tuckson
      Junior Member
      • Apr 2024
      • 4

      #3
      Thnx. I indeed started your first mentioned route. However, that second one sounds a lot easier?
      Made a clone of the concerning vm now and are going to do the inplace upgrade on that one. If it fails, I'll try the db thing.

      Comment

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

        #4
        Read through all the DB related upgrade notes in docs... there are things you may want to do at one point, like adding primary keys etc...

        Comment

        • Tuckson
          Junior Member
          • Apr 2024
          • 4

          #5
          Originally posted by cyber
          Read through all the DB related upgrade notes in docs... there are things you may want to do at one point, like adding primary keys etc...
          yes.

          I got the idea that a straight upgrade from 4.4 to 6.x was possible. However, the internal database stuff is not done automatically appearantly.
          So I am trying to find out where I can get scripts for the subsequent versions or instructions on what to alter manually if that really is the only way.

          Comment

          • irontmp
            Member
            • Sep 2023
            • 36

            #6
            Originally posted by Tuckson
            Hi,

            Art this moment we are in the middle of bringing an ancient platform to more modern times. One of the servers that has it's tern now is our Zabbix server.
            This thing is running virtual (KVM) and is installed on Centos 8 stream. We are running version 4.4.10 with Mysql als DB.
            The target environment is RHEL 9.3 with Zabbix 6.4

            Of course I would like to preserve all dashboards and stuff inside zabbix, but I am new to this. (Never worked with Zabbix before) . I learned 4.4.10 does not run on RHEL 9. Moreover, it is not possible to copy data 1 on 1 to 6,4 since during the versions quite some changes have been made. So it feels a bit like the chicken and the egg discussion.
            What is the best way to go?

            THIA
            To upgrade your Zabbix server from 4.4.10 on CentOS 8 Stream to 6.4 on RHEL 9.3, follow these steps:
            1. Backup Current Environment:
              • Backup MySQL database:bash
                Copy code
                mysqldump -u [user] -p [database_name] > zabbix_backup.sql
              • Backup Zabbix configuration files from /etc/zabbix/.
            2. Set Up New Environment:
              • Install RHEL 9.3 and apply updates.
              • Install Zabbix 6.4 on RHEL 9.3 following official documentation.
              • Install MySQL or PostgreSQL on the new server.
            3. Upgrade Path:
              • Incrementally upgrade Zabbix:
                • 4.4.10 -> 5.0
                • 5.0 -> 5.4
                • 5.4 -> 6.0
                • 6.0 -> 6.4
            4. Perform Incremental Upgrades:
              • Install Zabbix 5.0 on a temporary server (CentOS 8 Stream).
              • Restore the database and upgrade to 5.0:bash
                Copy code
                rpm -Uvh zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix_server -c /etc/zabbix/zabbix_server.conf --upgrade
              • Repeat for 5.4 and 6.0.
            5. Migrate to RHEL 9.3:
              • Backup the upgraded 6.0 database.
              • Install Zabbix 6.4 on RHEL 9.3.
              • Restore the database:bash
                Copy code
                mysql -u [user] -p [database_name] < zabbix_backup.sql
              • Verify and adjust configurations as needed.
            6. Test and Finalize:
              • Ensure all dashboards and monitoring items are functional.
              • Decommission old servers and temporary upgrade servers.
              • Update documentation with new server details and changes.

            This process ensures a smooth upgrade while preserving your Zabbix data and configurations.

            Comment


            • Tuckson
              Tuckson commented
              Editing a comment
              Just a note that by following this process I succeeded in the upgrade. Thnx again. For others: Maybe a bit of a loner path, but it helps in reaching milestones underway.
              Also: Do not forget to upgrade your DB when upgrading to 6 (primairy keys) and when creating a new DB before importing the old DB, mind the character set setting.
          • Tuckson
            Junior Member
            • Apr 2024
            • 4

            #7
            Thank you for this extensive answer.
            However, on multiple places I read that I need to manually run sql scripts after the upgrade steps?

            BTW, I cloned the zabbix server, so I can perform the upgrades on that one.

            Comment

            • tim.mooney
              Senior Member
              • Dec 2012
              • 1427

              #8
              Originally posted by Tuckson
              However, the internal database stuff is not done automatically appearantly.
              That is not true. The database upgrades are usually done automatically as part of the upgrade. That's what cyber outlined in the 2nd option presented. If you appropriately copy your 4.4 database to a system using the Zabbix 6.0.x or 6.4.x server and point that server at the 4.4 database, the very first thing it's going to do on startup is attempt to update the tables/views/indexes to match what a 6.0.x or 6.4.x database should have.

              The one "special case" here is the 6.0.x series. If you were upgrading from 4.4 to 5.0.x, or 5.2.x (now EOL) or 5.4.x (also EOL, I think), all the database upgrades would be attempted automatically. Indeed, even upgrading from 4.4.10 to 6.0.x would attempt to apply all of those upgrades plus the upgrades for 6.0.x.

              There is, however, a one-time manual step you would do after the 6.0.x upgrade. This step applies primary keys in certain history tables that didn't have them prior to 6.0.x. The Zabbix developers didn't include it in the automatic process for a very good reason: for very large sites, the creation of primary keys on those potentially huge tables could take a very long time. They left it as a manual, post-upgrade task so that very large sites didn't have to have a lengthy outage for the main 6.0.x upgrade.

              Also, be advised that I've said "attempt to" in a few places here. The automatic database updates can fail, especially if your database is old and has been upgraded many times in the past. You can run into situations where things like indexes didn't get dropped (or created) for some older release and that causes a subsequent upgrade to fail because it's expecting something that isn't true about your database.

              Be sure you have a good backup of your database before you start the upgrade process. That way, if it fails, you can revert, figure out what may be out of sync with your current database (or what instructions you didn't follow with regard to upgrades...) and fix it and try again.

              Comment

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

                #9
                Originally posted by irontmp
                [*]Incrementally upgrade Zabbix:
                • 4.4.10 -> 5.0
                • 5.0 -> 5.4
                • 5.4 -> 6.0
                • 6.0 -> 6.4
                There is absolutely no reason to do multiple incremental upgrades. One upgrade is all you need. Main thing is to remember, that heart and soul of Zabbix is its DB, which has to be upgraded by built-in processes. You have to copy your old schema (and data) to new platform and first run of new version server should do it all. As tim.mooney mentioned it may hit a snag sometimes, so backups and restore points etc are required, so you can try again after fixing some issues.. And, as mentioned, there are some tasks to be done manually. Those are described in manual...

                Comment

                Working...