All I did (in the cluster where rancher is installed) was:
1. scale down rancher to 0 replicas in the old namespace "XYZ"
2. change the "meta.helm.sh/release-namespace" annotation from the old namespace "XYZ" to "cattle-system" in the PriorityClass "rancher-critical" and ClusterRoleBinding "rancher" resources
3. delete the ingress in namespace "XYZ"
4. install rancher via helm chart in namespace "cattle-system"
5. wait 10 to 30 minutes
6. check that everything works and the rancher-managed clusters are all connected to the new rancher installation in namespace "cattle-system"
7. delete the old rancher installation in the old namespace "XYZ"
8. Done.