Ad Widget

Collapse

How to change Zabbix Database

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • target
    Junior Member
    • Nov 2022
    • 21

    #1

    How to change Zabbix Database

    Hello All,

    I am trying to change the database to Zabbix 6.2. Basically I have copied an old mysql database from another Zabbix and need to load it on a new Zabbix server. Is it possible?


    Best Regards,
  • Answer selected by target at 29-11-2022, 12:58.
    Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1782

    Yes, see for example https://majornetwork.net/2022/01/mov...bbix-database/

    The steps in brief:
    - Dump the database on the old server: mysqldump --single-transaction zabbix | gzip > /mnt/zbx-dump.sql.gz
    - Copy the file to the new server
    - Create the new empty database on the new server and create the zabbix database user (see Zabbix installation documentation for details if needed)
    - Load the database: zcat zbx-dump.sql.gz | mysql -u zabbix -p zabbix

    When starting the new Zabbix server with the new database it will automatically update the database to the new schema, see zabbix_server.log for any errors.

    (Disclaimer: the commands above were tested with MariaDB 10.1.x and 10.5.x, in MySQL the command defaults may be different, I don't know.)

    Markku

    Comment

    • Markku
      Senior Member
      Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
      • Sep 2018
      • 1782

      #2
      Yes, see for example https://majornetwork.net/2022/01/mov...bbix-database/

      The steps in brief:
      - Dump the database on the old server: mysqldump --single-transaction zabbix | gzip > /mnt/zbx-dump.sql.gz
      - Copy the file to the new server
      - Create the new empty database on the new server and create the zabbix database user (see Zabbix installation documentation for details if needed)
      - Load the database: zcat zbx-dump.sql.gz | mysql -u zabbix -p zabbix

      When starting the new Zabbix server with the new database it will automatically update the database to the new schema, see zabbix_server.log for any errors.

      (Disclaimer: the commands above were tested with MariaDB 10.1.x and 10.5.x, in MySQL the command defaults may be different, I don't know.)

      Markku

      Comment

      Working...