Werk #13312: omd mv/cp: Improve handling of site renamings

Komponente Core & setup
Titel omd mv/cp: Improve handling of site renamings
Datum 20.10.2021
Checkmk-Editon Checkmk Raw (CRE)
Checkmk-Version 2.1.0i1
Level Bedeutende Änderung
Klasse Neues Feature
Kompatibilität Kompatibel - benötigt kein manuelles Eingreifen

Users which execute 'omd mv' or 'omd cp' expect Checkmk to not only rename the site, but also migrate the Checkmk configuration in a way that they can continue seamlessly with their existing Checkmk configuration.

This feature did not exist before and was a common misunderstanding.

OMD itself is only caring about migrating the files and file parts that are initially installed with the skel hierarchy of OMD and under control of it. *Clearer:* If you create a clean site and then execute 'grep -r $OMD_SITE etc' in your site, you can see a lot of files which contain the ID of the site. These things are already migrated by OMD.

But OMD is not aware of the configuration files of the applications shipped with OMD. For example the Checkmk configuration files are not understood by OMD. And that's totally fine from an architectural point of view, because OMD is a separate component that manages installation of different applications, but must not mess with their individual files.

However, from a user's perspective it's clear that you also want the application files to be migrated during site renaming. And this is what we'll now start to work on.

We are now caring about the migration of more configuration parts.

Technical details:

  • OMD detects changes of the site ID (mv, cp or restore)
  • Then it executes the command 'post-rename-site -v -o [OLD_SITE_ID]'
  • The command 'post-rename-site' then takes care of the Checkmk configuration updates
  • It can also detect some situations it can not solve on it's own and warns the user about potential manual steps to do afterwards.
  • The migration steps are realized in so called rename action plugins. Examples can be found in the Checkmk git below 'cmk/post_rename_site/plugins/actions/sites.py` or in the site at 'lib/python3/cmk/post_rename_site/plugins/actions/sites.py'.

    Zur Liste aller Werks