How to rename a domain
How to rename a domain
Problem
How to rename a domain in ZCS.
Resolution
Before renaming a domain, couple of things must be checked/done before hand.
Prerequisites:
1. Make sure the DNS records (MX records too) are changed beforehand to reflect the new domain, and to match the IP of the server. 2. Check the hosts file of the server, and in any other servers, where this server exists. 3. Take a backup. Whether full backup, snapshot of VM, or rsync the /opt/zimbra directory, its strongly recommended to have a backup.
rsync -e ssh -axvzKHS /opt/zimbra/ 10.0.0.1:/tmp
- that command will copy /opt/zimbra directory to a remote machine with IP 10.0.0.1, in the /tmp directory (using ssh).
Or, you can copy it to a local mounted disk:
rsync -axvzKHS /opt/zimbra /mnt/zimbra_backup
4. Important. If in the domain that you want to rename, there is an account/s for calendar resources (meeting rooms, equipment), rename it, so that it belongs to a different domain. If you have just one domain, create a dummy domain, so that you can rename the resource, to have that dummy domain. When the rename is done, you can rename it back to the new domain. If you don't rename it, the old domain and the new domain will end up in "shutdown" state. If for some reason you forgot to rename the resource, execute the below commands to fix it:
zmprov -l md olddomain.com zimbraDomainRenameInfo "" zmprov -l md olddomain.com zimbraDomainStatus active zmprov fc domain olddomain.com zmcontrol restart
You need to do that for the old domain and for the new domain, as when that shutdown issue happen, the old domain will not be removed, and you will end up with two domains: the old and the new in shutdown state. That is connected to the following bug: https://bugzilla.zimbra.com/show_bug.cgi?id=47159
Additional Content