The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Need to forward Emails to new server (Urgent)

Discussion in 'E-mail Discussions' started by Worsin, Nov 1, 2010.

  1. Worsin

    Worsin Member

    Joined:
    Jan 16, 2008
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Salt Lake City, Utah
    I am currently moving servers and want to keep my same Nameservers so i planned on the following execution.

    1. Copy accounts to new server in small batches
    2. Point A Records to new server
    3. Point MX records to new server
    4. Once all accounts are copied over switch IP at the Registrar level to point to new server and all should be good.

    At least I think lol this is my first move like this so im really needing some advice

    The biggest problem I am having is email not forwarding.
    How do I forward email to a new server?

    I tried putting the IP address in MX record but I know it wants a host name really.

    Is there a way to change the CNAME on my old server for the mail.domian.com address to point to the new server IP?

    Also how can I send emails from the old server to the new one if they were left behind during the move?
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    The MX record could be mail.domain.com or domain.com, but it should not be the hostname nor an IP. If you set the MX records to mail.domain.com, you can then change the mail.domain.com entry from a CNAME to an A record and point the A record to the new machine's IP.

    As for forwarding emails, couldn't you inform customers beforehand and ask them to retrieve emails at both locations until the move has completed, then you could simply rsync their emails after you've switched everything over just for the mail. rsync is the fastest method to get the new mails onto the server.

    First, create a file in /tmp called movelist on the new server:

    Code:
    touch /tmp/movelist
    In that file, put the stuff you want to rsync over:

    Code:
    /home/user1/mail
    /home/user2/mail
    /home/user3/mail
    Then run the following command in screen on the new server:

    Code:
    for file in `cat /tmp/movelist` ;do rsync --archive --verbose --rsh=ssh
    oldserverIP:$file $file ;done
    This will rsync those files to the new machine. Because the command has the --archive setting, if you re-run rsync again in 12 hours or something, it will only rsync over the changed files or new files. Of note, it might be possible to wildcard the usernames in the movelist. I really haven't ever tried working with the movelist file sufficiently to know if that's viable as an option or not. You are welcome to play around with it to see.
     
Loading...

Share This Page