views:

177

answers:

2

I am changing the DNS of a domain to point to a new server. What is the best way to handle this to make sure the transition goes as smoothly as possible, specially pertaining to email? Ideally I would like their current emails to not be lost. I believe they are just using webmail at the moment.

Thanks!

A: 

As long as the MX (mail exchange) records are not updated everywhere (could take many days), you can still get mail traffic to the old server at the same time when other mail goes directly to the new one. Configure the old server to forward all the mails it receives to the new server, either using numeric IP, or verifying that the old server has access to updated DNS records.

How you do mail forwarding depends on the mail software you run on the old mail server.

antti.huima
Thanks for the answer. Much appreciated.
Hunter
But you have control of the "many days", just decrease the TTL of the MX records in advance. (And do not forget to put them back to the old value, after the change.)
bortzmeyer
+2  A: 

You didn't provide enough information to give you a great answer, but this may help:

It is non-trivial to move mailboxes between mail providers. If all of your users used local mail clients, then they could just download the mail locally and they wouldn't notice anything different when the DNS changed. If they are all using webmail, you'll need to run some scripts to move their mail to the new provider.

If you're worried about losing incoming email when you change mail servers -- don't! The sending mail servers will queue mail for redelivery. The only trick is that you need to clear out the old MX records with enough time for your TTL to expire before adding the new MX records.

T=0: remove MX records from DNS

T=1: set up user accounts and domain configuration at new mail server

T=2: add MX records for new mail server

lucas-insasho
Thanks. Yeah, I realized I wasn't being very informative. Wasn't sure what info would be helpful. As far as transferring emails (if they aren't using local clients), I found this tool imapsync that looks like it might be what I am looking for. Is there something better I should be looking into?
Hunter
Removing the MX records do *not* stop the delivery of emails, they will be sent to the A (or AAAA) record. If you want to completely stall email receiving, you need to stop the SMTP server.
bortzmeyer