Something I’ve recently been working on is upgrading a large number of Zabbix servers

  • Zabbix 4.0 LTS to 6.0 LTS
  • CentOS 7 to Ubuntu 20.04
  • MySQL to PostgreSQL

This is the workflow I settled on:

  • Backup the original CentOS 7 server and do a DB dump
  • Deploy a new temporary Ubuntu 20.04 server - we will use this server for the purposes of the upgrade and then delete it later
  • Install Zabbix 4.0 and PostgreSQL 12 using Ansible (https://galaxy.ansible.com/community/zabbix, https://galaxy.ansible.com/geerlingguy/postgresql)
  • Transfer the DB from the original server to the new server, and migrate it to PostgreSQL 12 using pgloader
  • After validating the migration was successful, upgrade Zabbix 4.0 to 6.0
  • Upgrade PostgreSQL from 12 to 13
  • Start the Zabbix service and validate that we are now successfully running 6.0 on pgsql13 and the data is intact
  • Power off the original CentOS 7 server, to avoid IP conflicts
  • Deploy a new Ubuntu 20.04 server using the same IP as the original server - this will be the final destination for our Zabbix
  • Install Zabbix 6.0 and PostgreSQL 13 using Ansible (https://galaxy.ansible.com/community/zabbix, https://galaxy.ansible.com/geerlingguy/postgresql)
  • Import the DB from the temporary upgrade server, and start the Zabbix service
  • Done!

Here are my notes containing more details about each step:

You can also view them on GitHub Gist

A big thanks to these resources which helped me accomplish this task: