I need to migrate an icinga2 host to a fresh one. Both are Ubuntu (20.04 β 24.04), Icinga is the last available version on 20.04: r2.14.6-1
Enabled features: api checker command icingadb influxdb mainlog notification
My plan is:
Setup new Ubuntu 24.04 host with Icinga 2.14.6-1 (to not have a newer version there)
Create DBs and users / grants (done by Puppet)
Dump/Restore all mysql databases
icingadb
icingaweb2
director
x509
vspheredb
Transfer
/etc/icinga*
/var/lib/icinga*
/usr/share/icinga*
/usr/lib/nagios/* (Monitoring-Plugins)
Change settings somewhere in /etc/icinga* and/or Director to match new hostname, do some magic stuff, scream and shout, read the documentation - but finally it will work
Switch clients to new server (performed by Puppet)
What is still unclear:
is there anything I have to do with the Redis DB of IcingaDB?
In general, your migration plan sounds solid. There are a few backup section in the different manuals, such as for Icinga 2, Icinga DB, or the Icinga Director.
As also stated in the Icinga DB docs linked above, you can ignore the Redis. If you want to be really sure that no data is lost, stop Icinga 2 first, wait a moment, stop Icinga DB and then dump the SQL database.
When starting up your new instance, Icinga 2 will populate the Redis again.
At the moment, I can think of none. However, please feel free to inform us if you forgot something.
Since I cannot say what you did in your setup previously, I can only add some speculative notes:
/usr/share/icinga* is βnormallyβ only changed via the package manager and installed packages. Therefor it should not be necessary to transfer anything.
/usr/lib/nagios/* same as above although people tend to place custom monitoring plugins there. It would preferable to only transfer those which are not installed via package manager (and those I prefer to place in a more fitting directory like /usr/local/bin or maybe /usr/local/lib/nagios/)
Some changes are required afterwards for the monitoring configuration, since the new machine probably has a different host name and you probably want to use that.