I didn’t get any good advice from Alma or Hetzner forums, so I changed the tactics.
- Backed up all the sites and took notes of all generic settings (e.g. firewall ports).
- Moved the backup files to another server with SCP
- Rebuilt the server with AlmaLinux 9
- Did basic hardening for the server (SSH port access, firewall etc.)
- Installed Virtualmin
- Moved the backup files back with SCP
- Restored the sites
It went pretty well. This guide was really helpful:
https://www.virtualmin.com/documentation/system/migrate/
I will handle my other servers with the same procedure.