Ad Widget

Collapse

5.0 to 6.0 database migration SQL queries

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jameskirsop
    Member
    • Jul 2018
    • 32

    #1

    5.0 to 6.0 database migration SQL queries

    We're running an instance with about 1300 nvps - and as such our database is considerably large.

    I know that adding a primary key to the items table is only done on new installs and can be done optionally AFTER an upgrade to the 6.0 database schema, but I'm trying to work out what other changes are made (i.e. what SQL is run against the database to migrate to 6.0) during the upgrade process to try and gauge how long an upgrade will take. I've done an upgrade of a test instance with a couple of hosts and the upgrade took a minute or two - so _something_ must be being processed during the database upgrade...?

    I've tried hunting around on the Github repo, but I've not come across anything that gives me that information. Is there a file or set of files that contain the SQL used to upgrade the schema/database version? For reference, I'm running on MariaDB.
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    There is a zabbix-sql-scripts package, which should contain that kind of stuff...
    I listed contents in other topic

    Comment

    • jameskirsop
      Member
      • Jul 2018
      • 32

      #3
      Originally posted by cyber
      There is a zabbix-sql-scripts package, which should contain that kind of stuff...
      That package contains a server.sql file which has table and data creation scripts for a new install, but after looking at it, it doesn't seem to have any conditionals to check for what version you're moving from and then running the required changes to move to dbversion 6000000.

      What I'm looking for is something that would check for what dbversion you're running, then executing SQL to modify the schema to bring the database inline with the latest. I'm guessing there would be more changes to execute when moving between LTS releases, rather than - for example - from 5.2 or 5.4 to 6.0.

      Comment

      • joostdeheer
        Junior Member
        • Feb 2022
        • 7

        #4
        Looks like this is done in the source code:

        zabbix-6.0.0\src\libs\zbxdbupgrade

        Comment

        Working...