Skip site navigation (1)Skip section navigation (2)
Date:      02 Feb 2002 23:22:58 -0700
From:      John-David Childs <freebsd@nterprise.net>
To:        Todd Martin <todd@decagon.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Migrating mail to a new server?
Message-ID:  <1012717378.23911.0.camel@dhcp14>
In-Reply-To: <v04220801b8827e36f05a@[192.168.1.100]>
References:  <v04220801b8827e36f05a@[192.168.1.100]>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 2002-02-02 at 22:49, Todd Martin wrote:
> Hi all,
> 
> How do I move/migrate user mail when I upgrade to a new box?

I've done this so many times, I can almost do it in my sleep.  In fact,
I'm about to do it again tomorrow :)  The following examples use
Sendmail, but the pattern is the same for any MTA.

> 
> I've got about 30 user mail boxes on an old Linux box. New box is 
> FBSD 4.5.

Most importantly:  check your sendmail.cf files.  You need to know, at
minimum, the following things:

MTA on both platforms.  (Hopefully they're the same :-)  Minor revision
differences are ok (e.g. Sendmail 8.10.X, 8.11.X, 8.12.X), but a major
revision difference between the two should make you re-triple check your
configuration files (/etc/sendmail.cf, /etc/aliases, /etc/mail/*).  Are
you running smrsh on the old machine?  How 'bout procmail mail
delivery?  Make sure those programs are in the right place on the new
machine, if applicable.  Mailing lists?  Majordomo/Mailman??  Set up
some test lists on the new box and make sure you can receive mail.  Send
mail from the new box and make sure the headers (domain name, host name,
etc) look ok.  Go back to step one if they don't (check your
sendmail.cf, /etc/mail/* files).  The new box can have the same hostname
as the old box, but obviously not the same IP address, and it can't be
in DNS until you're ready.

Speaking of DNS...are you moving the host.your.domain to a new IP
address?  If so, set your DNS time-to-live down to an our or less, and
set the refresh to something ridiculous (like 10 minutes).  If your mail
server isn't heavily used...these values can be 1-2 hours.

As for getting mail off the old box onto the new one after reboot...do
the following:

Assuming you have a backup MX host and you're bringing up the new box at
the same IP address as the old one, shut off the sendmail program on the
old box, scp the mailboxes from old hold to new host, down the old host,
bring up the new host, and the backup MX server will "discover" the new
box and deliver mail to it.  

If you don't have a backup MX server...either set one up, or configure
the old box to have a DIFFERENT IP address once you reboot it  (set
values in /etc/hosts, etc/sysconfig/network,
/etc/sysconfig/network-scripts/ifup-eth0, etc).  Reboot old mailhost and
new mailhost at (nearly) the same time...then scp the user's mail files
from old mailhost to new mailhost IN A DIFFERENT directory than the
default mail dropbox (i.e. NOT /var/mail/ or /var/spool/mail or
whatever), then use a foreach loop to diff the mailboxes (csh:  other
shells have a similar constructs).


 The transition needs to be quick -- turn off old box, 
> reboot new box with duplicated settings. Any new mail should get 
> delivered on the new box. How do I get the "leftover" mail off the 
> old, and onto the new?
> 
> ~Todd
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
--

jd



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1012717378.23911.0.camel>