How to rename a domain

How to rename a domain

   KB 23056        Last updated on 10/13/2016  

(0 votes)



0. Due to the steps below, it is recommended to do the rename off working hours.

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/
  • that command will copy /opt/zimbra directory to a remote machine with IP, 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 for ZCS 8.6. 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 zimbraDomainRenameInfo ""
zmprov -l md zimbraDomainStatus active
zmprov fc domain
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:

Renaming the Domain

After the prerequisite steps are done, rename the domain with the command:

zmprov -l rd [] []

Post Steps

  • Very important, after the domain is renamed, check if everything is working as expected. If all is OK, take a full backup.
  • According to the bug 47159, if the domain has an alias/es, the domain will end up in shutdown state. That at the moment is not true for zcs 8.6, but if you have domain aliases, they will be deleted, and you will have to recreate them again. Also the zimbraPrefFromAddress attribute is not changed. If you have users with this attribute set, you need to manually set that again.
  • Check that the zmloggerhostmap doesn't contain entries of the old domain:
$ zmloggerhostmap
Zimbra Logger Service Hostname Map
---------------------   ---------------------
DNS Hostname            Zimbra Hostname
---------------------   ---------------------

Remove the old domain entry by running:

zmloggerhostmap -d

The change will reflect in some time.

Renaming ZCS 8.7 Domain

The command to rename the domain for 8.7 is the same:

zmprov -l rd [] []. 

However, the issue with the resource is fixed, also if you have domain aliases, they are not deleted after the rename. The only issue left is that the zimbraPrefFromAddress attribute is not changed. If you have users with this attribute set, you need to manually set that again.

Here is an output from the rename:

zmprov -l rd newdomain
domain olddomain renamed to newdomain
Note: use zmlocalconfig to check and update any localconfig settings referencing domain 'olddomain' on all servers.
Use /opt/zimbra/libexec/zmdkimkeyutil to recreate the DKIM entries for new domain name if required.

You will need to use zmlocalconfig to do the checks and the zmdkimkeyutil utility to recreate the DKIM entries if required.

Additional Content

Domain Rename Process

When you run this zmprov command, the domain renaming process goes through the following steps:

  • The status of the old domain is changed to an internal status of shutdown, and mail status of the domain is changed to suspended. Users cannot login, their email is bounced by the MTA, and accounts, calendar resources and distribution lists cannot be created, deleted or modified.
  • The new domain is created with the status of shutdown and the mail status suspended.
  • Accounts, calendar resources, distribution lists, aliases, and resources are all copied to the new domain.
  • The LDAP is updated to reflect the new domain address.
  • The old domain is deleted.
  • The status for the new domain is changed to active. The new domain can start accepting email messages.

Verified Against: Zimbra Collaboration 8.6, 8.5, 8.0 Date Created: 13/10/2016
Article ID: Date Modified: 10/13/2016

Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Wiki/KB reviewed by SME1 SME2 COPY EDITOR Last edit by Teodor Vizirov
Jump to: navigation, search