Results 1 to 8 of 8

Thread: [SOLVED] How to rename domain name from test.domain.com to domain.com.

  1. #1
    Join Date
    Dec 2007
    Posts
    30
    Rep Power
    7

    Thumbs up [SOLVED] How to rename domain name from test.domain.com to domain.com.

    Objective :
    After I installed Zimbra mail server for test, it had domain test.domain.com. Today I want to change current domain and migrate all data from test.domain.com to test.com. Furthermore I want to set email alias from old account to new account too.

    Server and Domain Detail:
    Server host name (check by command #uname -n) : mail.test.domain.com
    Old domain name : test.domain.com (user has email xxx@test.domain.com)
    New domain name : domain.com (user has email xxx@domain.com)
    Zimbra server version : 5.0.2 (Upgrade from 4.0.9)

    Summary steps :
    1. Update DNS for support new domain name.
    2. Rename domain name.
    3. Create old domain by virtual domain.
    4. Set alias email from old domain to new domain.
    5. Set A record & MX record from your Hosting.

    Estimate time : 90 Minutes.

    All steps :

    1. Smile

    2. Stop Zimbra service

    3. Backup Zimbra.
    # cd /opt
    # tar cvfz zimbra20080321.tgz zimbra
    4. Start Zimbra Service again.

    5. Check Zimbra service
    # su - zimbra
    # zmcontrol status
    5.1 If you found this message :
    Host mail.test.domain.com
    antispam Running
    imapproxy Running
    ldap Running
    logger Running
    mailbox Stopped
    zmmailboxdctl is not running
    mta Running
    snmp Running
    spell Running
    stats Running
    You must delete this file /opt/zimbra/log/zmmailboxd.pid by this command :
    # zmcontrol stop
    # rm -rf /opt/zimbra/log/zmmailboxd.pid
    # zmcontrol start
    6. Check Zimbra service again.
    # su - zimbra
    # zmcontrol status
    6.1 If you found this message :
    Host mail.test.domain.com
    antispam Running
    antivirus Running
    imapproxy Stopped
    nginx is not running
    memcached is running
    ldap Running
    logger Running
    mailbox Running
    mta Running
    snmp Running
    spell Running
    stats Running
    You must run this command (Type 1 line):
    # su - zimbra
    # zmprov ms mail.test.domain.com zimbraImapSSLBindPort 7993 zimbraImapBindPort 7143 zimbraPop3BindPort 7110 zimbraPop3SSLBindPort 7995
    # zmcontrol stop
    # zmcontrol start
    # zmcontrol status
    7. Change DNS and MX Record

    * Change Zone from test.domain.com to domain.com in file /etc/named.conf from
    zone "test.domain.com" IN {
    // for common resolving
    type master;
    file "test.domain.com.fwd";
    allow-update { none; };
    };
    to

    zone "domain.com" IN {
    // for common resolving
    type master;
    file "domain.com.fwd";
    allow-update { none; };
    };
    * Copy file from /var/named/test.domain.com to /var/named/domain.com.fwd
    * Edit detail in file /var/named/domain.com.fwd
    $TTL 86400
    @ IN SOA mail.test.domain.com. root.domain.com.(
    2008020500 ; Serial
    28800 ; Refresh
    14400 ; Retry
    3600000 ; Expire
    86400 ) ; Minimum
    IN NS mail.test.domain.com.
    IN MX 10 test.domain.com.

    IN A 192.168.201.3
    mail IN A 192.168.201.3
    to

    $TTL 86400
    @ IN SOA mail.test.domain.com. root.domain.com.(
    2008031900 ; Serial
    28800 ; Refresh
    14400 ; Retry
    3600000 ; Expire
    86400 ) ; Minimum
    IN NS mail.test.domain.com.
    IN MX 10 mail.domain.com.

    IN A 192.168.201.3
    mail IN A 192.168.201.3
    mail.test IN A 192.168.201.3
    8. Reload named config
    # service named reload
    9. Change domain name from test.domain.com to domain.com
    # su - zimbra
    # zmprov -l rd test.domain.com domain.com
    ** -l = LDAP
    ** rd = Rename Domain

    10. Initial Document feature.
    # su - zimbra
    # zmprov in wiki@domain.com
    # zmprov impn wiki@domain.com /opt/zimbra/wiki/Template Template
    11. Restart&check status of zimbra service.
    # su - zimbra
    # zmcontrol stop
    # zmcontrol start
    # zmcontrol status
    12. Create virtual host for domain.com (Admin page)
    12.1 Click Domain -> domain.com -> Virtual Hosts
    12.2 Create virtual host : mail.domain.com
    10. Test send&receive email.

    11. Test create/edit/delete document.

    12. Create test.domain.com domain by Zimbra Administrator page. (After rename completed, someone may be sent email to xxx@test.domain.com so I will create test.domain.com and set alias email from test.domain.com to domain.com for all user)
    12.1 Click Domain -> New
    Domain : test.domain.com
    Default class of service : default
    Domain status : active
    12.2 Next
    12.3 GAL Mode : Internal
    12.4 Authentication mechanism : Internal
    12.5 Virtual host : test.domain.com
    12.6 Select : Create domain level document space
    12.7 Finish
    13. Create all user on test.domain.com like domain.com and set forward email from test.domain.com to domain.com. You can create&set forward email by this script :
    #!/bin/bash
    ################################################## ###############################
    # File name : ForwardEmailAll.sh #
    # Objective : Create alias email fro all user from old domain to new domain. #
    # Create : March 20, 2008 #
    ################################################## ###############################

    FromDN=$1;
    ToDN=$2;
    NUM_ARGU=$#;

    HELP(){
    echo "Help";
    echo "$0 [From doman] [To Domain]";
    echo "Example :";
    echo " $0 test.domain.com domain.com";
    exit;
    }

    if [ ${NUM_ARGU} -ne 2 ]
    then
    HELP;
    else

    for ID in `zmprov gaa ${ToDN} | awk -F'@' '{print $1}'`
    do
    echo "zmprov ca ${ID}@${FromDN} admin1";
    zmprov ca ${ID}@${FromDN} admin1
    sleep 1;
    echo "zmprov ma ${ID}@${FromDN} zimbraprefMailForwardingAddress ${ID}@${ToDN}";
    zmprov ma ${ID}@${FromDN} zimbraprefMailForwardingAddress ${ID}@${ToDN}
    done
    fi
    14. Test send email from domain test.domain.com and check new email in domain domain.com.

    15. If you have good solution , please let me know.
    --------------------------------------------------------------------------
    Normal man

  2. #2
    Join Date
    Oct 2007
    Posts
    3
    Rep Power
    8

    Default

    Successfully changeddomain name from domain.co.yu to domain.rs.
    Thanks man

    Changes:

    Chapter 7: I am created two zone files for bind9
    Chapter 12: doesn’t create virtual host
    Chapter 12.5 doesn’t create virtual host

    Additional: in admin>general>default domain icked domain.rs

    Cheers

  3. #3
    Join Date
    May 2006
    Location
    USA
    Posts
    6,242
    Rep Power
    21

    Default

    Welcome to the forums,
    BTW there's a new command:
    zmprov -l renameDomain test.domain.com domain.com
    -Helps a bunch if you don't want to do domain forwarding etc.
    (You still have to update DNS/MX/Bind etc - that just takes care of things Zimbra side.)

  4. #4
    Join Date
    Apr 2007
    Location
    Kajang, Selangor, Malaysia
    Posts
    122
    Rep Power
    8

    Default

    Guys;
    I want to rename my test.domain.com to domain.com. Does the command "zmprov -l renameDomain test.domain.com domain.com" change the whole Zimbra setup including the user email address (from user@test.domain.com to user@domain.com) ?

    Thanks.
    Matnor

  5. #5
    Join Date
    Apr 2007
    Location
    Kajang, Selangor, Malaysia
    Posts
    122
    Rep Power
    8

    Default

    I can't login after renamed the domain. Zmcontrol Status - all running

  6. #6
    Join Date
    Apr 2007
    Location
    Kajang, Selangor, Malaysia
    Posts
    122
    Rep Power
    8

    Default

    Quote Originally Posted by matnor View Post
    I can't login after renamed the domain. Zmcontrol Status - all running
    OK. Can login now after run zmprov mcf zimbraDefaultDomainName domain.com.

  7. #7
    Join Date
    Apr 2007
    Location
    Kajang, Selangor, Malaysia
    Posts
    122
    Rep Power
    8

    Default

    I've upgraded to 5.0.11 FOSS successfully with new domain.

    Thanks to Zimbra.

    Matnor

  8. #8
    Join Date
    Feb 2009
    Posts
    7
    Rep Power
    6

    Default

    Would renaming the domain and affect ZCO users, i.e resyncing their mail? A lot of our users are offsite with slower connections and large mailboxes!!

    I have tested this with zimbra on a virtual machine, but can't remember what the result was. Can someone confirm?

Similar Threads

  1. Rename Zimbra master domain
    By leog21 in forum Installation
    Replies: 4
    Last Post: 02-17-2009, 07:29 AM
  2. Replies: 20
    Last Post: 03-18-2008, 06:37 AM
  3. [SOLVED] Remove main domain!
    By zibra in forum Administrators
    Replies: 11
    Last Post: 09-27-2007, 09:50 AM

Posting Permissions

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