Migrating IMAP to another server-- need suggestions

myusername

Well-Known Member
PartnerNOC
Mar 6, 2003
693
1
168
chown -R us.*yourbase*
cPanel Access Level
DataCenter Provider
Twitter
Let me know if you see any holes in my plan!

First of a quick background:

1. Server A and Server B have identical copies of a website including the maildir
2. Server A is currently the mail server
3. The site uses IMAP so once it has been migrated to server B, the files need to be there:

What I am going to do:

1. Change the MX on server A to point to Server B
2. On server A remove the domain from /etc/localdomains and stick it in /etc/remotedomains
2. Replicate the /mail dir one final time from A to B

It sounds to me like using this method we would be waiting on DNS to do its thing and even after the changes were made that some mail could still wind up on server A.

But it also sounds to me like setting up /etc/remotedomains is the patch for this problem and that it will force the mailserver to read the MX on the domain and forward it on immediately.

Main thing is to sync IMAP over to an identical server then have the mail be immediately redirected to that server. See anything I missed?
 

Lyttek

Well-Known Member
Jan 2, 2004
775
5
168
That sounds pretty much like what I had to do when migrating from an Exchange box... used an imapsync script... the movement of the local/remotedomains sounds right.

As for DNS, if you have the time beforehand, drop the TTL for the mx records to something really low, such as 300 or 600 (5-10 minutes, respectively) a few days before the transfer to help with DNS propogation ... then up that limit when the transfer is done.
 

myusername

Well-Known Member
PartnerNOC
Mar 6, 2003
693
1
168
chown -R us.*yourbase*
cPanel Access Level
DataCenter Provider
Twitter
Sounds good, and that part was definately in the plans. thanks for bringing it up though for any others.

So sounds like to me we are still at the mercy of DNS even with the local/remotedomains entries?

I was thinking something could be done to force mail from server A to server B (without setting up some sort of proxy on the mail ports...too much work, too little time for that I think)
 

Lyttek

Well-Known Member
Jan 2, 2004
775
5
168
If you have the DNS on server A pointing to server B as the actual MX host, AND you have the remote/localdomains worked out, you shouldn't have any messages getting delivered to serverA maildir's, regardless of DNS timings, old cache entries elsewhere, etc.