I have done this a couple of times...

The mailstore is pretty straight forward... Just make sure (for simplicity
sake) to maintain the same uid and gid for vpopmail from the old server to
the new server... I just find there is less headaches that way and it is a
rather simple thing to do at the very begining of a new vpopmail install.

To move the initial data I use a streaming tar over ssh... Overkill...
perhaps... But still geeky and fun. :)

On the current mail server I do:

tar -cpzvf - /usr/home/vpopmail/domains/ | ssh [EMAIL PROTECTED]
'/usr/bin/tar -x -C /usr/home/vpopmail/domains/ -pzvf -'

Basically, this creates a tar to stdout and then pipes the stdout to ssh,
which inturn pipes it to tar which is set to read from stdin.

I do this via tar since 1) It is fast. (rsync is also fast, but depending on
the size of the transfer, a very large memory hog) 2) Can be done while in
production 3) looks cool.

Once I'm ready to cut over to the new server... I down smtp, qmail, pop3 and
then wait for all qmail processes to finish delivery etc... Once everything
is complete and exited... I run rsync to bring the two mailstores in sync
with each other.

On the new mail server I run:

rsync --verbose --progress --stats --compress --rsh=/usr/bin/"slogin -l
root -o
Compression=yes" --recursive --times --links --perms --owner --group --delet
e [EMAIL PROTECTED]:/usr/home/vpopmail/domains/

I use rsync the second time around because it is faster than a complete
mailstore copy... and when you are dealing with 16GB mail stores... You want
to waste as little downtime as possible... Besides... you are doing this
during maintance window (aren't you ;)) so nobody wants to spend hours
waiting for data to move between servers... I have better things to do with
my time at 3:00am... like sleep... mmmm sleep... good... I digress...

Anyways... As for the qmail files... You can just move those over if you
want to, using any program of your choice... I like scp but that is me...

You want to make sure you get the following files:

/var/qmail/user/assign (If you only move that file over... make sure you run
/var/qmail/bin/qmail-newu to generate a current assign.cdb file... you can
also just copy that file over if you like... they are very portable
according to DJB.)

I think that about covers it... Obviously if you have any .qmail files
etc... you want to maintain a consistant dir structure between your
installations of vpopmail... IE: don't have vpopmail installed in
/usr/local/vpopmail on the old server and /usr/home/vpopmail on the new
server... it is difficult to do this sort of migration and you can easily
avoid these sort of problems provided you take your time and setup vpopmail

Tom Walsh
Network Administrator

-----Original Message-----
From: Jojo [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 19, 2003 1:07 PM
Subject: [vchkpw] How do I safely copy all maildirs?

Hello NG,
I have an old freebsd server running and want to move all domains maildirs
etc to my new server.
Now can somebody please tell me how to safely copy all virtual
domains/maildirs to the new server. What is with the var/qmail/users/ stuff?
And so on?
I am sure somebody here did this already.
Every server uses qmail with vpopmail.

Thank you!

Reply via email to