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. I would prefer 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.
I installed the “fresh” plugins on the new server and just copied the missing ones. In the future, I will start to migrate them to another folder to have a clean situation next time
Thanks for your helpful answer and the included information!
Migration was successful, even if it was a little bit painful due to a “creative” mix of manuell settings and puppet stuff. I also changed the hostname, so every client needed a fresh ca and certificate - which was easy done with puppet.
Regarding the documentation: after using open source software for so many years, I never trust the documentation. You never know, if the documentation gets that much love, the code gets. And even the icinga documentation is a litte bit “thin” in some parts, i.e. the Icinga for Windows documentation mentions the “-InstallCommand”, but I did not find any other options I could pass to the installer (which would have helped in changing the CA).