LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Migrating Sendmail to New IPs (https://www.linuxquestions.org/questions/linux-server-73/migrating-sendmail-to-new-ips-552335/)

ABL 05-08-2007 01:17 PM

Migrating Sendmail to New IPs
 
Hi,
I am hosting 8-10 sites, email, etc., and I'm moving everything to a new server. I've already migrated all of the sites, and one entire domain (complete with email). That one domain was small (most of the mail is for me, so it was easy to deal with the time delay).

I have to move the other domains, and I am trying to minimize downtime for email. I have http taken care of, as I will have sites live at both the old and new IP addresses, but I'm scratching my head over dealing with sendmail. Most of the users are POP, but I also have a few IMAP users (on each of 2 domains).

I am moving to hosting DNS with this upgrade, so I was wondering if I should:
1) edit the zone files on the new box to point to the old server
2) change TTL on the new box to something relatively small (one hour?)
3) wait a day or two for everything to propagate
4) shut down sendmail on the old server
5) copy the mail over to the new server
6) change the DNS to point to the new server
7) wait for propagation and I'm good to go

Will this work? I have heard that some large ISPs ignore TTL, so some users may not get mail at the new IP right away (a bad thing for me).

Someone had suggested using redir or iptables (to forward from the old server to the new), but I haven't been able to get either to work.

Should I be looking at MAIL_HUB? I've looked, but I got a little hung up. The new server has a valid hostname, but obviously, the other sites are just IPs for now (with all files and users set as with the old ones).

Any help would be appreciated.

Thanks,
Alden

acid_kewpie 05-10-2007 01:48 AM

well ultimately mx records have their own failover mechanisms ready and waiting. put the old server with the highest priority in DNS, then the new one with a lower one. once you stop sendmail on the old server the connecting mail servers will then try to use the other mx record, meaning you don't need to synchronize any events at all.

ABL 05-10-2007 08:52 AM

Quote:

Originally Posted by acid_kewpie
well ultimately mx records have their own failover mechanisms ready and waiting. put the old server with the highest priority in DNS, then the new one with a lower one. once you stop sendmail on the old server the connecting mail servers will then try to use the other mx record, meaning you don't need to synchronize any events at all.

Wow! I wish I had thought of it. You're a life saver (or, at least, a sanity saver). I really appreciate this much simpler solution.
I still have one or two questions, though:
When I ultimately shut down the old server, do I just bring over any mail left on that server and append the new mail to the old? What do I do about IMAP clients (I only have 2)?


Thanks,
Alden

acid_kewpie 05-10-2007 09:30 AM

how to actually keep the mail totally up to date i'm not sure. with a small outage you could just copy all files manually, but there are tools like imapsync which might be useful to keep two locatiosn up to date until such tim eas youre back to a single one. never used it myself though. also there's plain old rsync, another good tool for sure.

ABL 05-10-2007 10:25 AM

Okay. I found one little problem:
the mx records for both the old and new server are called: mail.foo.com, and I don't want to have to change the name of one of them, as that kind of defeats the purpose.

Is it possible/advisable to put IP addresses in the MX record, instead of a hostname (and then having an associated A record with the IP address)? Is there another way around this?

Thanks,
Alden

acid_kewpie 05-10-2007 10:47 AM

yeah i think you can. you could always just use a temporary a record for the new server anyway.


All times are GMT -5. The time now is 06:14 PM.