Ad Widget

Collapse

4.0 to 5.0 Database Compatibility

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wb1
    Junior Member
    • Sep 2020
    • 1

    #1

    4.0 to 5.0 Database Compatibility

    I attempted to upgrade from 4.0 to 5.0, however, I failed miserably and was unable to restore the old server. At this point, I have a complete backup as recommended in the upgrade guide. Since I am attempting a complete re-install anyways, I'm just going to install 5.0 directly. Is it possible to just import the DB itself from 4.0 to a new 5.0 install with no compatibility issues?
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    If you have a complete backup, simply connect your 5.0 Zabbix server to the 4.0 database and start it and it will be automatically upgraded to the 5.0 database. If there were any errors during the upgrade process, please let us know the details.

    Comment

    • tim.mooney
      Senior Member
      • Dec 2012
      • 1427

      #3
      I agree with what Atsushi said, but just so that you understand a little bit more, I'll add a couple details.

      You don't say anything about which database software you're using on the 4.0 server or what version it is. It would be good if you provided that info, as it might allow us to help you better.

      One of the very first things that happens every time you restart your zabbix_serverd process is that it examines what zabbix minimum and optional schema version your database reports. You will see messages similar to these in your zabbix_server.log on startup:

      Code:
      26591:20200611:175348.053 current database version (mandatory/optional): 04040000/04040002
      26591:20200611:175348.053 required mandatory version: 04040000
      If the "current database version" is less than the "required mandatory version", that generally means that you've just started up a newer version of the zabbix_serverd after an upgrade, so the next thing the zabbix_serverd process will do is issue database commands to alter the schema to bring it up to the required version. As Atsushi said, if you point zabbix server 5.0 at a 4.0 database, it's going to (attempt to) upgrade it to be a 5.0 database.

      When upgrading to a new series within a Zabbix major version, for example from 4.0 to 4.2 or 4.2 to 4.4, the schema changes are often (but not always) smaller and have a high degree of success on upgrade. These upgrades are usually pretty easy, but you still always want to read the upgrade notes, release notes, etc.

      The database schema upgrade from 4.0 to 5.0 has been more problematic for a number of people, not so much because the schema changes are that complicated but, at least when using MySQL/MariaDB/Percona as your database backend, Zabbix is now requiring newer features in the database software. This is why it's important to include information on what database software and version you're using, because the types of problems you're likely to run into is going to depend very much on those things.

      So, under normal conditions starting up zabbix_serverd 5.0.3 and pointing it at your old 4.0 database would just upgrade it to be a 5.0 database, but you may have more work to do before that upgrade could succeed. Again, depending on your database software and version.

      Comment

      Working...