Ad Widget

Collapse

Restore the DB from zabbix_server (Zabbix) 6.0.40 to zabbix_server (Zabbix) 7.0.12

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sg-sysadmin
    Junior Member
    • May 2025
    • 1

    #1

    Restore the DB from zabbix_server (Zabbix) 6.0.40 to zabbix_server (Zabbix) 7.0.12

    Hi

    I'm in the process of upgrading our Zabbix infrastructure and have encountered a database schema upgrade issue. Environment Details:
    • Current Production Server:
      • Zabbix version: 6.0.40 (LTS)
      • OS: Ubuntu 22.04
      • MySQL/MariaDB used for the Zabbix database
    • New Target Server:
      • Zabbix version: 7.0
      • OS: Ubuntu 24.04
      • Clean installation with Zabbix 7.0 packages

    What I Did:
    1. Performed a full mysqldump of the zabbix database on the 6.0.40 server.
    2. Restored the dump on the newly installed Zabbix 7.0 server.
    3. After restoration, I attempted to start the Zabbix server service to trigger the automatic schema upgrade.

    Issue:


    Upon starting the Zabbix server, I received the following error on the web frontend:
    "The Zabbix database version does not match current requirements. Your database version: 6010005. Required version: 7000000."

    From the logs, I see that the upgrade fails during patch 06010006:

    query failed: [1050] Table 'userdirectory' already exists database upgrade failed on patch 06010006, exiting in 10 seconds
    I suspect a conflict between pre-existing schema objects in the restored database and what the Zabbix 7.0 upgrade scripts expect.
    Request:


    Could you please advise on the recommended way to proceed?
    • Is there a supported method for migrating a Zabbix 6.0 database to a Zabbix 7.0 installation?
    • Is it expected to step through minor version upgrades (e.g., 6.0 → 6.4 → 7.0) rather than jumping directly?
    • Should I drop specific objects before the upgrade, or is there a cleaner migration approach?


    Thanks in advance for your help.

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

    #2
    you say "you restored the dump on v7 server"... Did you also create DB before that? What version of DB shcema did you use? 6 or 7? Your way is basically OK, but you have to first create your db using v6 schema on your new server. That ensures, that you do not have any of those tables, that upgrade wants to create.
    So, delete your DB, go find schema creation scripts from v6 (.40) installation (or sources), use those to create a DB, then restore your old one (or if your dump contains all table creation also, then just skip any schema creation) and then start your v7 server to perform upgrades...

    Comment

    Working...