i'm looking at a migration of users to a new server, located
elsewhere, in the coming months. i'm building a server virtually
identical to what my systems are currently running on. using vpopmail
5.4.10, with mysql db backend.
something that intrigued me was this old email that's quoted in the
mysql readme file for vpopmail installation (edited for brevity)
From: "Ken Jones" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, September 09, 2004 3:48 AM
Subject: Re: [vchkpw] vpopmail + billing server integration
> > On Wed, 8 Sep 2004, Ken Jones wrote:
> > > Here is something we built into vpopmail for sites like yours.
> > > Use mysql on the email server. Have the billing system
> > > insert an entry in the vpopmail table, leaving the directory
> > > field blank. vpopmail will automatically create the users
> > > directory and update the database when any program
> > > tries to deliver mail to the user, or authenticate as the user.
> >
> > (I know this is getting offtopic...) So I could use an INSERT statement in
> > SQL instead of vadduser? Or am I not understanding this correctly?
>
> That is the idea. A while back some folks wanted to hook up their billing
> systems to vpopmail. Basicly they would insert into the vpopmail sql table.
> The only thing they couldn't do easily was create the hashed directory path.
> So we put in vpopmail code to check if the path is blank and automatically
> create the new path and update the database.
what i was hoping to do was - at the appropriate cutover time - take
a snapshot of the vpopmail mysql db's, install that on the new
vpopmail server (and update dns to redirect connections there), then
- over the course of probably a day - transfer all the existing email
on the server over the WAN to the new server. this would allow for a
relatively smooth cutover - only IMAP users with lots and lots of
email on the server would experience much disruption, as they'd have
to wait for the data to be copied over. but because of the
non-colliding nature of maildir files, it shouldn't matter when the
data xfer occurs after the cutover.
the only issue is the directory structure. the above quoted email
says that vpopmail will create the new user dir if there's no hashed
directory path in the db. i could have sworn that i'd read on the
list that if a user had been created in the db - but not their
directory - then when they first logged in, the structure would be
created (using the hashed path already in the db). i may be
misremembering the above text however. it would solve the problem
perfectly though - those users who log in after the cutover would be
presented with a new - but blank - maildir, and later it could be
populated with their stored mail from the old server. but if vpopmail
will only create the user's space if the db has no hashed directory
path, then that won't work, as vpopmail would likely organize the
user dirs with different paths than currently exist (due to account
deletions/creations since the time the original hashed paths were created).
am i making an iota of sense? i was thinking that the one alternative
could be to use 'find' to create a list of all the existing
directories, and recreate them on the new server - then the users
would be 'in place' at the same time as the mysql db is put in place.
only thing there is that it does take a while for find to walk
through several tens of thousands of directories to record them, so
there might be an inconsistency if a customer created a new account
right then. that would be a small price to pay though.
yow, this is long. sorry for blabbering on so much. any thoughts?
Paul Theodoropoulos
http://www.anastrophe.com
http://www.smileglobal.com
http://www.forumgarden.com