Migration of SMTP servers ??

2 posts / 0 new
Last post
#1 Fri, 10/06/2017 - 01:50
vincen

Migration of SMTP servers ??

Hi

Do some guys have found an easy way to migrate mail servers between virtualmin instances ? I use the backup feature to transfer easily a customer account from one of my server to the other one but how do you handle the mail issue ?? I mean fact that during few hours/days some emails will still arrive at old server (due to DNS refresh) !!

Thanks for your ideas,

Vincèn

Fri, 10/06/2017 - 04:01
Joe
Joe's picture

I've done a bunch of mail migrations over the years.

You have a lot of options.

You can:

  1. rsync mail after your shutdown receiving mail on the old server. Just be aware of UID/GID, if you don't choose to keep them the same on the new server (i.e. if Virtualmin remaps them because other users are already on the old UID/GIDs).
  2. Shut down the mail server on the old server during the migration. Mail won't bounce, it'll just be temporarily delayed on the sending servers (greylisting does the same thing, basically...forcing the sender to re-send after a delay). Most mail servers will keep mail up to week before considering it unsendable, as long as there's MX records and such. But, I only like to use this method if I expect the new server to be up in a few minutes.
  3. Configure the old server as a hold and forward server for the new server, and don't turn on Postfix on the new server until the migration is done. This has the same effect. You tell the old server it is not longer able to deliver mail locally for the moving domain, and configure it to forward it to another server. It'll fail while it's down, but it'll just hold it and forward it once the new server is turned on.

The simplest is turning off the mail server on the old server and making the move as fast as possible. I've done it this way even on servers that have other domains, if I know it's only going to take a couple of minutes.

In all cases, whenever moving to a new server, make sure you make you DNS TTL really short a day or two before the move, so you can expect outside servers to pick up the change quickly once you change your mail server and other records.

Edit: In all cases, I recommend you practice on a development server. It's somewhat tricky to get all the bits to happen in the right order if you've never done it before.

--

Check out the forum guidelines!

Topic locked