This past week I migrated a relatively mature Checkmk site from a regular Linux host under Ubuntu 22.04 to a new, more powerful virtualization server hosting about a dozen Docker containers, including Checkmk.
Standing up the Docker container was far more complex than I thought it would by, by far!
I’m not all that new to Docker or Docker Compose. I’m running under the Arcane management UI and, among other containers, I already have UNMS, Unifi Controller, Technitium, NTFY, httpd, and NPM up, running, configured and in production. None of them took more than an hour or so to configure, run, test, and fix a few mistakes. In stark contrast, it took me probably a dozen hours or so, spread out over a few days, to get my site migrated over to Checkmk under Docker.
To be fair, standing up a brand new Checkmk container was easy. Maybe 30 minutes, if that. But getting it to use the site backup from the old Linux machine was just crazy difficult!
After the quite normal steps of running OMD on the old machine to create a backup, and then moving that file to the persistent Docker volume on the Docker machine, things became “interesting”. In the hope of helping someone else down the road, here is what I did, for better or worse:
- Bring up the from-scratch Checkmk Raw container, which causes an empty site
called "cmk" to be created.
I also added into the compose file an extra tmpfs entry for the soon to
be created new site.
- Shell into the Checkmk container and use OMD to
Stop the cmk site
Change the cmk site ports to something non-standard
Disable the cmk site
Restore the migrated site
Copy the "special" cmk_docker.conf apache conf file from the cmk site to the new site
The new site doesn't have that file. I could not get the website to function without
it and this single issue caused me many hours of debugging and research.
That file is apparently only for Docker instances and the migrated site was coming
from a regular instance of Ubuntu, not a Docker instance.
Use OMD config to change the internal OMD site IP from [127.0.0.1] (appropriate
for the regular Ubuntu environment) to [0.0.0.0] (for the Docker evironment.
- Stop the container, change the site name in the compose file from cmk to the migrated
site name, then start the container and start the migrated site.
As far as I can see, these steps to migrate from a regular instance to a Docker instance are nowhere to be found on Checkmk web site. And it ought to be easier. Maybe it is. Maybe there are some environment variables I could have used to point the container at the site backup file and it would have automagically restored it and fixed the Apache configuration.
At any rate, I hope this helps someone in the future. If I did do it the hard way, please let me know!