1. Overview
Upgrading Debian from 8 (jessie) to 9 (stretch) with check-mk installed isn’t as easy as it seems. You have to:
- Upgrade check-mk to 1.4.0 and fix all issues
- Backup all sites
- Purge check-mk
- Upgrade debian
- Reinstall check-mk 1.4.0
- Restore the check-mk-sites from backup
2. Upgrade check-mk and back it up
Download the .deb package and install it. Follow the official the official guide and upgrade all sites. After fixing all issues, create a backup of each site:
# su - <sitename> $ omd backup site.name.tar.gz
Repeat this for all sites.
3. Remove check-mk and upgrade to stretch
Stop sites:
# su - <sitename> $ omd stop
Repeat this for all sites. Then remove (purge) check-mk:
# dpkg -P check-mk-raw-1.4.0p17
Once this is done, update the distribution to debian (you really should know how to do that!). Autoremove all obsolete packages and reboot.
4. Reinstall check-mk and restore from backup
Download the .deb package for stretch and install it. Since you autoremoved dependent packages earlier, the install will most likely fail. Fix it with:
# apt --fix-broken install
Now we can restore the sites from our backup (as root!):
# omd restore <site-name.tar.gz> # su - sitename $ omd start
Repeat for all sites and fix all remaining issues.
5. Notes
Of course you don’t want to do this without a security net. Take a snapshot and destroy that instead of the real VM. How to do that with KVM and libvirt is explained here.