From: Terry Barnum on
After becoming frustrated with our current (non-postfix/dovecot) mailserver's IMAP performance, I setup postfix+dovecot+mysql on a MacPro running Snow Leopard (10.6.2) using MacPorts and an unused domain. After getting it working and playing with it a bit I now have what is likely a very-wet-behind-the-ears newbie question:

When it's time to swap servers, is there a preferred recipe to move to new hardware while using the same domain? I googled and checked the FAQ and archives but didn't have a whole lot of luck.

I think it would be something like:

- configure new postfix/dovecot server to be in correct domain (conf files, certificates)
- setup users and passwords on new postfix/dovecot server
- use imapsync to pull all email from old server to new postfix/dovecot server
- wait for a Friday night
- swap DNS to point to new postfix/dovecot server
- turn off smtp on the old server
- use imapsync again to pull any new email from old server to new postfix server
- turn off old server

Is this a reasonable approach?

Thanks,
-Terry

Terry Barnum
digital OutPost
San Diego, CA

http://www.dop.com
800/464-6434

From: Adrian Overbury on
Terry Barnum wrote:
> After becoming frustrated with our current (non-postfix/dovecot)
mailserver's IMAP performance, I setup postfix+dovecot+mysql on a MacPro
running Snow Leopard (10.6.2) using MacPorts and an unused domain. After
getting it working and playing with it a bit I now have what is likely a
very-wet-behind-the-ears newbie question:
>
> When it's time to swap servers, is there a preferred recipe to move
to new hardware while using the same domain? I googled and checked the
FAQ and archives but didn't have a whole lot of luck.
>
> I think it would be something like:
>
> - configure new postfix/dovecot server to be in correct domain (conf
files, certificates)
> - setup users and passwords on new postfix/dovecot server
> - use imapsync to pull all email from old server to new
postfix/dovecot server

I think that there's an important step here that I always use when I'm
doing a mail migration. It could really go anywhere above the 'wait for
a Friday night' step, really. "Reduce the TTL on the domain to
something quite small, ie: 5 minutes." The point of this is that you'll
get an idea rather quickly of whether or not it works and, if it
doesn't, you'll be able to change it back without a portion of the users
experiencing long downtimes because of DNS records pointing to the wrong
server.

> - wait for a Friday night
> - swap DNS to point to new postfix/dovecot server
> - turn off smtp on the old server
> - use imapsync again to pull any new email from old server to new
postfix server
> - turn off old server
>
> Is this a reasonable approach?
>
> Thanks,
> -Terry
>
> Terry Barnum
> digital OutPost
> San Diego, CA
>
> http://www.dop.com
> 800/464-6434
>
>

--

Adrian Overbury

From: Terry Barnum on

On Feb 24, 2010, at 5:08 PM, Adrian Overbury wrote:

> Terry Barnum wrote:
> >
> > - configure new postfix/dovecot server to be in correct domain (conf files, certificates)
> > - setup users and passwords on new postfix/dovecot server
> > - use imapsync to pull all email from old server to new postfix/dovecot server
>
> I think that there's an important step here that I always use when I'm doing a mail migration. It could really go anywhere above the 'wait for a Friday night' step, really. "Reduce the TTL on the domain to something quite small, ie: 5 minutes." The point of this is that you'll get an idea rather quickly of whether or not it works and, if it doesn't, you'll be able to change it back without a portion of the users experiencing long downtimes because of DNS records pointing to the wrong server.

Thank you Adrian. It was suggested to me that swapping IP addresses of the old and new servers might be a safe way to accomplish this too just in case DNS caching still pointed to the wrong server for some users.

So an updated recipe could be:

- configure new postfix/dovecot server to be in correct domain (conf files, certificates)
- setup users and passwords on new postfix/dovecot server
- use imapsync to pull all email from old server to new postfix/dovecot server
- wait for a Friday night
- swap IP addresses of old server and new postfix/dovecot server
if all goes well {
- use imapsync again to pull any new email from old server to new postfix server
- turn off old server
}
else {
- swap IP addresses back
}

Terry Barnum
digital OutPost
San Diego, CA

http://www.dop.com
800/464-6434

From: Bas Mevissen on
On Wed, 2010-02-24 at 16:51 -0800, Terry Barnum wrote:

> When it's time to swap servers, is there a preferred recipe to move to new hardware while using the same domain? I googled and checked the FAQ and archives but didn't have a whole lot of luck.
>

Your domain has at least one MX record for receiving mail.
Suppose it is:

mydomain MX 10 1 day oldserver_ip

Change it to

mydomain MX 20 1 min oldserver_ip
mydomain MX 10 1 min newserver_ip

Enable the new servers SMTP and disable the old servers SMTP and IMAP.
Wait for a few minutes to make sure that all mail on the old server is
processed. Copy the IMAP mail folders to the new box. Now enable the
IMAP on the new server.

Change the DNS to

mydomain MX 10 1 day newserver_ip

(note: those 10 and 20 are priorities where mail is delivered)

When you want or can reuse the IP number of the old mail box, just pull
the old one from the net and give it a temporary different IP number.
Now enable the "old" IP number on the new box and enable SMTP. Copy the
IMAP folders from the old box to the new one and enable IMAP on the new
one.

You don't need to care much about a short downtime of your SMTP server.
Mail is fairly robust. Mail delivery will be automatically retried when
the receiving mail server appears to be down.

Last one: a lot of ISPs have a so called relay mail server. If you add
that one to your DNS' MX record, mail will be delivered to the relay
server when your server does not respond. When your server is up again,
the relay server will automatically deliver the mail to your server.

Good luck!

Bas.

From: Larry Stone on
On 2/25/10 2:35 AM, Bas Mevissen at abuse(a)basmevissen.nl wrote:

> Your domain has at least one MX record for receiving mail.
> Suppose it is:
>
> mydomain MX 10 1 day oldserver_ip
>
> Change it to
>
> mydomain MX 20 1 min oldserver_ip
> mydomain MX 10 1 min newserver_ip

MX records point to host names, not TCP/IP addresses. Also, the examles are
not in the correct format. An MX record should look like:

example.com. 60 IN MX 10 mail.example.com.

where the 60 is the time-to-live in seconds and the 10 is the priority.

In short, you need to know what you are doing with DNS before just blindly
following this advice.

--
Larry Stone
lstone19(a)stonejongleux.com
http://www.stonejongleux.com/