Results 1 to 3 of 3

Thread: Renaming server domain, but keeping it

Hybrid View

  1. #1
    Join Date
    May 2010
    Posts
    171
    Rep Power
    5

    Default Renaming server domain, but keeping it

    When I installed Zimbra I created the domain example.com and gave Zimbra the hostname zcs.

    I want to rename the server to mail.example2.com, but still keep the example.com domain and its users. If that makes sense.

    Do I accomplish this by using zmsetservername from zcs.example.com to mail.example2.com and then recreate the domain example.com?
    Last edited by yonatan; 05-07-2012 at 03:43 PM. Reason: Clarity

  2. #2
    Join Date
    May 2010
    Posts
    171
    Rep Power
    5

    Default

    How-to rename Zimbra hostname & domain and keep the domain and its users. The steps below elaborate on those found in this wiki

    Assumptions
    - Single server (installation domain zcs.example.com) running version 6.0.x
    - Split DNS (local Bind)
    - Want to rename server to mail.example2.com (note: hostname and domain changing)

    Steps

    BEFORE YOU FOLLOW THESE STEPS MAKE SURE YOU HAVE A BACKUP OF YOUR ZIMBRA SERVER!!!!

    1. Make sure Zimbra is running and put domain in maintenance mode

    Note: If Zimbra is stopped you will receive errors in step 5.
    Code:
    sudo su - zimbra
    zmcontrol status <-- should show running
    zmprov md example.com zimbraDomainStatus maintenance <-- users can't login and mail is queued
    2. Add new zone (example2.com) to bind
    Add example2.com zone

    Code:
    sudo vi /etc/bind/named.conf.local
    Copy db.example.com and modify db.example2.com with necessary changes (note: don't forget to increment the serial number
    Code:
    sudo cp /etc/bind/db.example.com /etc/bind/db.example2.com
    3. Restart bind
    Code:
    sudo /etc/init.d/bind9 restart
    4. Check that example2.com DNS zone is resolving
    Code:
    dig example2.com mx
    dig example2.com any
    5. Rename the server
    Code:
    sudo su - zimbra
    /opt/zimbra/libexec/zmsetservername -n mail.example2.com
    6. Reconfigure OS
    The following files should only reference mail, mail.example2.com and example2.com
    Code:
    sudo vi /etc/hostname
    sudo vi /etc/hosts
    sudo vi /etc/resolv.conf
    7. Reboot OS
    Code:
    sudo reboot
    8. Double check internal DNS
    Code:
    dig example2.com mx <-- should be the same as in step 4
    dig example2.com any <-- should be the same as in step 4
    host `hostname` <-- should show mail.example2.com
    9. Check Zimbra config
    - There will be some references to the old hostname zcs. Make sure you change them to your new hostname mail.
    - There will be references to example.com and you decide what needs to be changed

    Code:
    zmprov gacf | grep zcs <-- will show results (MODIFY!)
    zmprov gacf | grep example.com <-- will show results
    
    zmprov gs `zmhostname` | grep zcs <-- will show results (MODIFY!)
    zmprov gs `zmhostname` | grep example.com <-- will show results
    
    zmlocalconfig | grep zcs <-- should not show any results!
    zmlocalconfig | grep example.com <-- will show results
    10. Create a new SSL certificate

    11. Remove example.com zone from bind
    Code:
    sudo vi /etc/bind/named.conf.local <-- delete example.com zone
    sudo rm /etc/bind/db.example.com
    12. Create the domain example2.com
    zmsetservername does not create the domain example2.com, so to create it

    Code:
    sudo su - zimbra
    zmprov cd example2.com
    13. Change the default domain to example2.com
    Code:
    sudo su - zimbra
    zmprov mcf zimbraDefaultDomainName example2.com
    14. Don't forget to change the status of example.com back to active
    Code:
    sudo su - zimbra
    zmprov md example.com zimbraDomainStatus active
    Last edited by yonatan; 05-08-2012 at 01:46 PM. Reason: Clarity

  3. #3
    Join Date
    May 2010
    Posts
    171
    Rep Power
    5

    Default

    OK, I've tested zmsetservername several times and it works great except that I get this error every time,

    Getting global config zimbraLogHostname=ERROR; service.failure (system.failure: ZimbraLdapContext) (cause: javax.naming.CommunicationException zcs.example.com:389)

    Everything seems to be fine. I've gone through zmlocalconfig, zmprov gacf etc.


    SOLVED: If zimbra is stopped when you run zmsetservername you get this error!
    Last edited by yonatan; 05-08-2012 at 07:58 AM. Reason: Solved!

Similar Threads

  1. Replies: 1
    Last Post: 10-26-2012, 03:07 AM
  2. moving a domain to another server
    By mesbaba8 in forum Administrators
    Replies: 1
    Last Post: 05-01-2012, 02:56 AM
  3. Zimbra server cant email my domain
    By help_needed_z in forum Administrators
    Replies: 1
    Last Post: 10-20-2010, 12:38 AM
  4. Split Domain and Sync, Mirroring or Multi Server
    By hadirs in forum Installation
    Replies: 0
    Last Post: 04-10-2008, 05:45 AM
  5. CoS, Domain, Server
    By wcbenyip in forum Installation
    Replies: 5
    Last Post: 06-24-2007, 12:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •