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.

Email Migration and MX changes

Discussion in 'E-mail Discussions' started by trec-r, Oct 3, 2015.

  1. trec-r

    trec-r Active Member

    Joined:
    Aug 10, 2008
    Messages:
    41
    Likes Received:
    2
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    I need to move a hosting account along with some email accounts between servers. I need to ensure no emails are lost, and if there are a few duplicated emails that is ok. On the original server I have access to cPanel, on the new server I have access to WHM and cPanel, along with SSH. I have complete access to the domain name.


    My question is what happens to the emails on the original server when I change the MX settings? Will all the messages on the old server be transferred over to the new server?


    My biggest concern is that there will be some emails that will arrive at the original server before the MX changes propagate, however I do not know what the impact would be of changing the local MX settings to point to the new server.
     
  2. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    275
    Likes Received:
    31
    Trophy Points:
    28
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    Hello,

    No the emails will not migrate them self. What you would do is, migrate the entire cPanel account which will include all the current emails, then change over the DNS, the MX record will be pointing to the new server so all new emails will be sent there, however with any DNS change there will be a propagation period ~48 hours that you can expect emails to still be sent to the old server. You can setup a cronjob on the old server to rsync the mail folder to the new server, so any new emails sent there will be sent to the new server.

    Code:
    # rsync -ahvz ~/mail/domain.com/ cpuser@newserver:~/mail/domain.com/
    You will want to setup an SSH key so it happens automatically, otherwise you can do it manually however often you want. Just a note, if you delete any emails on the new server that existed on the old server, those emails will be sent again to the new server 'undeleting 'them.
     
  3. trec-r

    trec-r Active Member

    Joined:
    Aug 10, 2008
    Messages:
    41
    Likes Received:
    2
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    In the past I have changed the local MX records to point to the new server. If I recall correctly the server did forward all the emails, much to my surprise. I had thought it would only send new emails to the new server. However that was a number of years ago and I am not sure if I remember correctly.

    Code:
    # rsync -ahvz ~/mail/domain.com/ cpuser@newserver:~/mail/domain.com/
    You will want to setup an SSH key so it happens automatically, otherwise you can do it manually however often you want. Just a note, if you delete any emails on the new server that existed on the old server, those emails will be sent again to the new server 'undeleting 'them.[/QUOTE]

    How can I setup an SSH key without SSH access on the original server?
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,707
    Likes Received:
    658
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    You won't be able to utilize SSH if you don't have SSH access enabled for your account on the source server. However, you could manually download those mail files via FTP and then upload them to the new server.

    Thank you.
     
Loading...

Share This Page