Ad Widget

Collapse

Can I upgrade Zabbix6 by import database to a fresh 7.2 install?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • baalchina
    Junior Member
    • Jan 2020
    • 24

    #1

    Can I upgrade Zabbix6 by import database to a fresh 7.2 install?

    Hello everyone, I need to upgrade my Zabbix 6.0 to Zabbix 7.2.
    Since my OS is CentOS 7, I also plan to upgrade the operating system to Rocky Linux 9 at the same time.
    Is my approach feasible?
    1. First, back up the Zabbix 6 database, scripts, and other related files.
    2. Install Rocky Linux 9 and perform a fresh installation of Zabbix 7.2, but do not start it yet.
    3. Import the Zabbix 6 database into the Zabbix 7.2 database.
    4. Start Zabbix 7.2.
    Will it works? Or any suggestions?

    Thanks!
  • jtnfoley
    Member
    • Mar 2022
    • 76

    #2
    Very interested, I am about to do the same upgrade (6.0.x -> 7.2.latest)
    I'll also be partitioning (ABSOLUTELY MUST DO THAT FOR PRODUCTION IMHO!) and consolidating two servers into one for single-pane-of-glass view of my datacenters.
    Last edited by jtnfoley; 24-01-2025, 16:54.

    Comment

    • PZakrzewski
      Junior Member
      • Dec 2024
      • 12

      #3
      Well, that’s not as simple as you described.

      Depending on your environment, server size, database type, and other factors, the process may vary slightly, but here’s the way I would approach your scenario:

      1. Backup Everything:
      • Perform a full database backup using native tools (mysqldump for MySQL/MariaDB or pg_dump for PostgreSQL).
      • Backup your Zabbix configuration files from /etc/zabbix/ and any custom templates or scripts.
      • If running the server in virtual environment, backup the VM.

      2. Upgrade Zabbix 6.0 to 7.2 in the Current Environment:
      • Before migrating to Rocky Linux 9, upgrade Zabbix from 6.0 to 7.2 on CentOS 7.
      • Allow the Zabbix server process to handle all database schema migrations during this step.

      3. Migrate to Rocky Linux 9:
      • Install Rocky Linux 9 on the new server.
      • Install Zabbix 7.2 but do not start the Zabbix server yet.
      • Export the upgraded database from CentOS 7 and import it into the new server’s database.
      • Restore your backed-up configuration files and scripts.

      4. Start and Test Zabbix:
      • Start the Zabbix server on Rocky Linux 9 and verify it connects to the database without errors.
      • Test all key functionalities, including monitoring, alerting, and reporting.

      5. Optimize for Production:
      • Depending on your database type and size, consider implementing TSDB (Time Series Database) or partitioning for improved performance and manageability if not already done.

      There are also no Zabbix Server binaries in version 7.2 for Centos7, so You should compile it from sources.

      For complete instructions of the upgrade process You should follow the official documentation, here's the link:

      Comment

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

        #4
        Originally posted by PZakrzewski
        2. Upgrade Zabbix 6.0 to 7.2 in the Current Environment:
        • Before migrating to Rocky Linux 9, upgrade Zabbix from 6.0 to 7.2 on CentOS 7.
        .....
        There are also no Zabbix Server binaries in version 7.2 for Centos7, so You should compile it from sources.
        yea right... compile and upgrade on unsupported platform, solve gazillion issues to actually get it to compile ...

        Much easier is to intall new version side by side, but do not create new DB (no import of schema etc). Export your old DB as csv and import it to new platform (you can use DB creation scripts from your present version, ie 6.0). After first start, server "should" do all upgrade tasks. There are definitely things, that can go wrong, but you dont need to shut old one down until you get it all working, so not much of a downtime.

        Comment


        • PZakrzewski
          PZakrzewski commented
          Editing a comment
          Well, you don’t need to shut down the system if you're virtualizing - you could simply clone the VM and stage the upgrade safely.

          Regarding CentOS 7 and Zabbix 7.2, at time of my response there were no official Zabbix packages, similarly as there were no packages for Zabbix v6 on Rocky Linux 9, which both of them are available now, so compiling was reasonable option to suggest, sometimes in similar cases it's the only option. However, I didn’t initially consider your approach of exporting data as CSV and using the DB creation scripts from version 6 before upgrading - that does sound like a simpler alternative.
      • baalchina
        Junior Member
        • Jan 2020
        • 24

        #5
        Thanks all! I finished it, here is my steps:
        1. Install a new Rocky 9 in vmware, install zabbix6, transfer database(without history and trends because they are too large), and make zabbix 6 in Rocky run. This step is to check the way good, it can be ommited.
        2. Backup all files in old CentOS, and reinstall a new Rocky in the old server.
        3. Do the same thing in step 1.
        4. After a long time, everything goes fine.

        Comment

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

          #6
          You can import history and trends also later, when your instance is already up and running..

          Comment

          Working...