admin Site Admin
Joined: 21 Jun 2005 Posts: 209
|
Posted: Mon Jul 10, 2006 6:47 pm Post subject: Mail Server Move |
|
|
> Interesting idea as well. Perhaps i could use rsync to generate the
> customer directory structure in advance of the process, so that when
> the cutover happens the customers won't be faced with non-existent
> mailboxes (i was going to rely on ufsrestore building the directory
> heirarchies in advance of the data being copied over).
>
I would do the following:
1) Create a tarball of the existing client directory tree and extract it
in the new server's "live" location - don't worry about it changing
between now and the cutover, you'll resync it a couple times before then.
2) Use rsync to update the tree, including the --delete option to clear
out stuff that's been deleted from the source. It's a little less
efficient thatn it would otherwise be since Maildirs rename files to show
status, but it's still pretty clean. Do this sync a few times to get a
feel for how long it will take when you're ready for the final cutover.
3) Crank your DNS TTL way down - ~300 seconds or so is a good "switch"
time. You'll put it back up when you're finished with the move. You need
to do this at least old-TTL before you try to cut over, preferably 2x just
in case.
4) Do a final pre-cutover rsync to get it as close to current as possible.
This is actually the first part of the move, so continue onward
immediately once the rsync finishes.
5) Shut down the qmail-send portion on both the old and new servers - you
can have qmail-smtp running to queue-up new mail outbound. Also, shut
down all pop/imap servers until the transfer is done.
6) Do the LAST rsync, to catch any last-minute changes. If you've kept up
pretty well, this hopefully won't take more than 15 minutes or so. People
checking email won't be able to get in at this time, but sending email
should still work.
7) Change DNS while the rsync is running so that it propagates.
Start qmail-send and pop/imap on the new server. If you have webmail,
you can configure the old webmail to talk to the new imap server until you
shut it down as well.
9) Configure qmail-send on the old server to forward ALL email to the new
server by IP address (using smtproutes). Specify that the old server is
allowed to relay through the new server until it's shut down. Then start
qmail-send and flush the queue (svc -a) to forward all mail to the new
server's qmail-smtp instance. You may want to reduce the
concurrencyremote value before doing this to avoid overloading the new
SMTP server.
10) Once you're sure that everything is moved and DNS is pointing to the
new server, as well as the queue being flushed, shut down qmail on the old
one.
It's fairly involved, and does include some total downtime, but nowhere
near as much as a physical move, and has the advantage of being very safe
since you effectively run 2 parallel servers until the last second.
Josh
--
Joshua Megerman
SJGames MIB #5273 - OGRE AI Testing Division
You can't win; You can't break even; You can't even quit the game.
- Layman's translation of the Laws of Thermodynamics
josh@honorablemenschen.com |
|