[Dovecot] migrate 15K users to new domain name
odhiambo at gmail.com
Thu Apr 19 17:03:01 EEST 2012
On Thu, Apr 19, 2012 at 16:28, Jan-Frode Myklebust <janfrode at tanso.net>wrote:
> On Thu, Apr 19, 2012 at 02:01:44PM +0300, Odhiambo Washington wrote:
> > What do you mean by a "new domain" in this context?
> The user's email addresses are changing from username at old.domain to
> username at new-domain.
That can be handled by address rewrites within the MTA.
> > Is the server changing?
> > Is the storage changing?
> The user's home directory is based on the user's email address, so this is
In my setup, I have virtual users. So the home directory is in the
How is yours setup? If the domain name changed, from domain1 to domain2, I
believe it would be easy to change as follows:
mv $domain1 $domain2
Well, it the size of $domain1 is in TBs, I'd probably do it another way as
doing mv is a bit dangerous with very large datasets:
for d in `ls -1`; do mv $d domain2/$d; done [ or something closer]
> > In my thinking, a domain change is as simple as using a rewrite rule in
> > your MTA.
> Also the user's login-names needs to change from old to new domain, and
> all their data needs to move from old to new domain.
And the login names are stored in a flatfile or db?? Either way, you can do
Dump the database and just use vi to rename old-domain to new-domain, then
drop the db and import the dump.
mysqldump dbname dbname.sql
mysqladmin drop dbname
mysqladmin create dbname
mysql dbname < dbname.sql
You can also edit the flatfile to s/old-domain/new-domain/g
cat flatfile | xargs sed -i.BAK 's/old-domain/new-domain/g'
Maybe I still don't understand you:-)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
I can't hear you -- I'm using the scrambler.
Please consider the environment before printing this email.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 652 bytes
Desc: not available
More information about the dovecot