Ad Widget

Collapse

What is the best way to migrate data from Zabbix 4.0.46 to the latest 7.x?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dengolius
    Junior Member
    • Dec 2015
    • 4

    #1

    What is the best way to migrate data from Zabbix 4.0.46 to the latest 7.x?

    Hello folks!
    I have and old zabbix_server 4.0.46​ and I want to migrate only hosts with the their ip addresses + groups. I've tried to export data from old zabbix server via https://github.com/southbridgeio/zab...-export-import and the data has been exported without any issue, but I've failed in issue with restoring data to the new server zabbix_server7.0.0alpha7.
    So my question is the next: is there any way like version-to-version upgrading or another migrator which could help to migrate the data only from hosts and groups? I don't want to migrate all the data from monitoring at all, just don't want to do hand work for creation every new host.
    Last edited by dengolius; 11-11-2023, 13:07.
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    If you try to export/import with a tool, that has not had any updates for years and does not probably know a thing about v7, it should not be a surprise, that it fails...

    If you just want to copy some tables, you should look into their table structure on both versions. you may need to add columns, edit data etc... Probably noone has created a tool to migrate to version that is not yet official..
    If your new DB is set up properly you may succeed also in direct DB export and importing through CSV file, for example.. inserting data calls needed triggers in new db, which again creates correct entries etc...

    Comment

    • dengolius
      Junior Member
      • Dec 2015
      • 4

      #3
      Originally posted by cyber
      If you try to export/import with a tool, that has not had any updates for years and does not probably know a thing about v7, it should not be a surprise, that it fails...

      If you just want to copy some tables, you should look into their table structure on both versions. you may need to add columns, edit data etc... Probably noone has created a tool to migrate to version that is not yet official..
      If your new DB is set up properly you may succeed also in direct DB export and importing through CSV file, for example.. inserting data calls needed triggers in new db, which again creates correct entries etc...
      So zabbix don't have any useful and working tool to migrate data from older version to newer without hard working? As I see there is only one way is running upgrade from version to version from the 4th to 7th and hope for the best that everything will go well.

      PS: How stupid this looks from the outside... As far as I understand, for those who are willing to pay money, such migration tools are ready and waiting for a happy buyer?

      Comment

      • solution
        Senior Member
        • Jun 2020
        • 269

        #4
        If you just want the Hosts, no scripts or tools are needed.
        On the Web Gui/Admin
        Old Zabbix Server: Hosts --> Select and Export
        New Zabbix Server: Hosts --> Import


        Wellington​

        Comment

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

          #5
          Originally posted by dengolius

          So zabbix don't have any useful and working tool to migrate data from older version to newer without hard working? As I see there is only one way is running upgrade from version to version from the 4th to 7th and hope for the best that everything will go well.

          PS: How stupid this looks from the outside... As far as I understand, for those who are willing to pay money, such migration tools are ready and waiting for a happy buyer?
          You do not have to go through every single version in between. if platform allows, you can go directly from 4 to 7. Usually does not, so you still need to deal with DB migration etc...
          I don't think they have special tools, just knowledge, what to do and some experience, which makes it quite fast. I have used upgrade services once in the looong past (when direct upgrades were not yet possible)... and no there was no special tools, just a knowledgeable guy, who knew exactly what to do..

          And yea, if its just hosts, you can export them from GUI. Maybe I was a bit stuck on the bigger upgrade plans and platform change etc..

          Comment

          • dimir
            Zabbix developer
            • Apr 2011
            • 1080

            #6
            It should not be an issue. First thing - you need the fresh OS. So, I'd do the following:

            - get fresh OS
            - stop zabbix server 4.0.46
            - dump its database to an SQL file (use mysqldump)
            - copy that SQL file to the fresh OS
            - create empty database for Zabbix in your sql server (see section c. Create initial database on https://zabbix.com/download but just create the database, user and grant privileges)
            - feed that SQL file to that empty database
            - install Zabbix 7.0 on the fresh OS (again, see https://zabbix.com/download but skip the database part)
            - in Zabbix 7.0 server configuration set the DBName to that newly created database
            - start Zabbix server 7.0.x

            When Zabbix 7.0 will start it will connect to the old database and detect that it needs to be upgraded. It will then perform the upgrade automatically (keep in mind, that depending on your DB size it might take some time). After you started Zabbix server, follow on what it's doing in the log file:
            Code:
            tail -F /var/log/zabbix/zabbix_server.log
            After the upgrade process finishes, the 7.0.x Frontend will be able to connect to the same database and you can check things.
            Last edited by dimir; 16-11-2023, 19:28.

            Comment

            • sistemi
              Junior Member
              • Mar 2025
              • 1

              #7
              Originally posted by dimir
              It should not be an issue. First thing - you need the fresh OS. So, I'd do the following:

              - get fresh OS
              - stop zabbix server 4.0.46
              - dump its database to an SQL file (use mysqldump)
              - copy that SQL file to the fresh OS
              - create empty database for Zabbix in your sql server (see section c. Create initial database on https://zabbix.com/download but just create the database, user and grant privileges)
              - feed that SQL file to that empty database
              - install Zabbix 7.0 on the fresh OS (again, see https://zabbix.com/download but skip the database part)
              - in Zabbix 7.0 server configuration set the DBName to that newly created database
              - start Zabbix server 7.0.x

              When Zabbix 7.0 will start it will connect to the old database and detect that it needs to be upgraded. It will then perform the upgrade automatically (keep in mind, that depending on your DB size it might take some time). After you started Zabbix server, follow on what it's doing in the log file:
              Code:
              tail -F /var/log/zabbix/zabbix_server.log
              After the upgrade process finishes, the 7.0.x Frontend will be able to connect to the same database and you can check things.
              Hi thank you, can I use this procedure to jump from 3.2 to latest ?

              Comment

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

                #8
                Originally posted by sistemi

                Hi thank you, can I use this procedure to jump from 3.2 to latest ?
                yes, you can.

                Comment

                Working...