Ad Widget

Collapse

zabbix 4 to zabbix 5 migration

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dave08
    Junior Member
    • Jan 2020
    • 29

    #1

    zabbix 4 to zabbix 5 migration

    Hello. I've been using a Zabbix 4 Virtual Box appliance on ubuntu 16.0.4 LTS. Today I found that version 5 LTS is already here and based in CentOS 8, which is great as I prefer Red Hat based Linux and I already imported Zabbix 5 appliance to Virtual Box. I didn't see any information on how to upgrade using appliances, and this is the best way I have to run Zabbix.
    Which is the best way to upgrade? Use a mysqldump and import the database, or is there any full Import/export method? isn't it necessary to adpat the mysql database to run version 5?
    Thanks and regards.
    David

  • aib
    Senior Member
    • Jan 2014
    • 1615

    #2
    1) deploy new server using new IP
    2) export MySQL database from old server using any way which you would like (phpMyAdmin, mysql CLI, backup, etc)
    3) transfer exported DB to new server and import it
    4) transfer configuration files / scripts from old Zabbix server to new one.
    5) stop old server
    6) change IP on new server to IP from old server
    7) import MySQL database on new server and restart mysqld to check if it is working correctly.
    8) restart new Zabbix Server daemon and check log file for any error.
    9) enjoy
    Sincerely yours,
    Aleksey

    Comment

    • dave08
      Junior Member
      • Jan 2020
      • 29

      #3
      Thank you so much for the reply.
      Are the templates also exported within the database? I'm afraid I might forget something.

      Comment

      • dave08
        Junior Member
        • Jan 2020
        • 29

        #4
        Hello again. So today I could finally dedicate some time to this. Exported mysql database from zabbix 4 (ubuntu vm) and imported to zabbix 5 (centos 8.1).
        The web login shows: "
        • The frontend does not match Zabbix database. Current database version (mandatory/optional): 4010004/4010004. Required mandatory version: 5000000. Contact your system administrator."
        shouldn't there be a script to convert the tables between these 2 major versions?
        Thanks and regards.
        Dave

        Comment

        • tim.mooney
          Senior Member
          • Dec 2012
          • 1427

          #5
          There's no script to convert the database, step 8 in aib 's instruction covers that. When the zabbix_serverd process is started, it looks at the reported database version and upgrades it to the required schema.

          You didn't do the mysql import with zabbix_serverd running, did you?

          Comment

          • dave08
            Junior Member
            • Jan 2020
            • 29

            #6
            Originally posted by tim.mooney
            There's no script to convert the database, step 8 in aib 's instruction covers that. When the zabbix_serverd process is started, it looks at the reported database version and upgrades it to the required schema.

            You didn't do the mysql import with zabbix_serverd running, did you?
            Thanks for the reply. I don't think I did.
            I'm using one zabbix appliance with ubuntu and the other with CentOS 8, both running in VirtualBox. Could this be an issue?

            LOG

            Click image for larger version

Name:	Annotation 2020-07-10 170525.jpg
Views:	5395
Size:	68.3 KB
ID:	404938
            Last edited by dave08; 10-07-2020, 18:06.

            Comment

            • tim.mooney
              Senior Member
              • Dec 2012
              • 1427

              #7
              That shouldn't make any difference.

              Have you restarted zabbix_serverd on the 5.x appliance? Are there any database-related messages in the log?

              Comment

              • dave08
                Junior Member
                • Jan 2020
                • 29

                #8
                Originally posted by tim.mooney
                That shouldn't make any difference.

                Have you restarted zabbix_serverd on the 5.x appliance? Are there any database-related messages in the log?
                Thanks for the reply.
                Of course I did. It even rebooted.
                "table already created". I think I'll have to drop the database, create it again instead of restoring directly...

                Comment

                • dave08
                  Junior Member
                  • Jan 2020
                  • 29

                  #9
                  It worked!
                  Stopped zabbix-server and agent;
                  mysql drop database zabbix; create database zabbix;
                  mysql -u root < zabbix < zabbix.backup.sql
                  systemctl start zabbix-server
                  /var/log/zabbix/zabbix_server.log was showing progress % updating database.
                  the only thing is "database is not upgraded to use double precision values"
                  Will this be an issue?
                  Thanks and regards.

                  Comment

                  • tim.mooney
                    Senior Member
                    • Dec 2012
                    • 1427

                    #10
                    It's not really a problem, but it's also very easy to apply that change too. Read the section about "Enabling extended range of numeric (float) values": https://www.zabbix.com/documentation...rade_notes_500

                    Comment

                    • dave08
                      Junior Member
                      • Jan 2020
                      • 29

                      #11
                      Originally posted by tim.mooney
                      It's not really a problem, but it's also very easy to apply that change too. Read the section about "Enabling extended range of numeric (float) values": https://www.zabbix.com/documentation...rade_notes_500
                      Ok, thanks!

                      Comment

                      • alfonsil
                        Junior Member
                        • Nov 2020
                        • 1

                        #12
                        Good morning,

                        i would like to migrate from zabbix 4.2 to 5.2 and i have read your hint. On step 6 you change IP on new server to IP from old server. My question is it....Is it possibile to import mysql db and configuration from old to new server and continue to use both of them with different ip? I would like to migrate client gradually to a new 5.2 server but having the db and configuration of the old server that stay online.

                        Thanks in advance

                        Luigi

                        Comment

                        • dave08
                          Junior Member
                          • Jan 2020
                          • 29

                          #13
                          [QUOTE=splitek;n413482]You can't do this. When you upgrade Zabbix from 4 to 5 DB structure are modified, so you can't use it with different versions of Zabbix.

                          Hi. What do you mean by can't doing it. I did. I imported a zabbix4 database into zabbix and it is working perfectly (on my previous post from January 2020).
                          Last edited by dave08; 19-11-2020, 19:28.

                          Comment

                          • tim.mooney
                            Senior Member
                            • Dec 2012
                            • 1427

                            #14
                            Originally posted by dave08
                            Hi. What do you mean by can't doing it. I did. I imported a zabbix4 database into zabbix and it is working perfectly (on my previous post from January 2020).
                            Look at the new question by Luigi in this thread just before splitek 's reply. That's what the response is related to, not to your original question. Splitek's reponse to Luigi is 100% correct, but Luigi's question is slightly different from your original question.

                            Comment

                            • malik123
                              Junior Member
                              • Nov 2020
                              • 1

                              #15
                              I might want to move from Zabbix 4 to 5 and I have perused your clue. On stage 6 you change IP on the new worker to IP from the old worker. My inquiry is it...Is it conceivable to import MySQL DB and setup from old to new work and keep on utilizing the two of them with various IP? I might want to relocate the customer bit by bit to another 5.2 worker yet having the DB and arrangement of the old worker that stay on the web. minecraft pour pc
                              Last edited by malik123; 24-11-2020, 17:00.

                              Comment

                              Working...