Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Need to forward Emails to new server (Urgent)

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

  1. Worsin

    Worsin Member

    Jan 16, 2008
    Likes Received:
    Trophy Points:
    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 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

    Oct 2, 2010
    Likes Received:
    Trophy Points:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    The MX record could be or, but it should not be the hostname nor an IP. If you set the MX records to, you can then change the 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:

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

    Then run the following command in screen on the new server:

    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.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice