Migrating Mail Accounts


What's the best way to move contents of email accounts from one hosting server to another during migration? By the best way I mean for a administrator who doesn't yet have extensive knowledge of Linux RH.
Who is Participating?
Hmm - I'd approach this a little differently, as so to overlap services, and not risk email getting stranded.


(1)  set up a subdomain such as mail2.yourdomain.com that points to the new server
(2) setup the new account(s) on the new server
(3) redirect email from the old account by forwarding emailaddress@yourdomain.com to emailaddress@mail2.yourdomain.com
(4)move the mx record to point to the new server (i.e. to mail2.yourdomain.com)
(5) resend the email from the old server to the new one.

 If you are using sendmail on the old server, you resend the email by using the formail command on the old server from your mailbox directory:

cd /var/spool/mqueue
formail -f -s sendmail -v -oiee emailaddress@msil2.yourdomain.com < emailbox

To automate this, you could set up the full complement of email addresses, and create a small shell script like:


formail -f -s sendmail -v -oiee $1@mail3.dataease.com < $1
mv $1 old/.

and then call the script with the argument of the mailbox name.

You need to transfer the mail boxes in /usr/spool/mail from your old box to the new one.
you can create a tar box in the old box

cd /usr/spool/mail
tar cf /tmp/mailbox.tar .

#Don't a WHTIE SPACE after mailbox.tar following by a DOT.
then copy mailbox.tar  to your new box, in your new box do:
make sure there is no duplicate account between old and new box, the the UIDs
are unique.

cd /usr/spool/mail
tar xvf /pathto/mailbox.tar

then transfer the user account details accross (login name, password and group infor etc), you need to transfer/or merge the follow file under the /etc dir:
 passwd, shadow, group and gshadow

have a look at the /etc/password file to see where the user's home dirs located, transfer them to the new box as well.

You need to transfer the user's account accross
SlavyanAuthor Commented:
To Yuzh:

I was thinking more like using a GUI utility you could recommend as I'm not too good at the root level yet. Does any GUI app come to your mind?
Thank you.
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

SlavyanAuthor Commented:
To both Yuzh & Periwinkle:

Guys, can I solve this problem by using Plesk?
I don't manage servers via Plesk, but I have worked with Plesk accounts.

I don't know of any functionality in Plesk that will auto-magically move mail accounts for you - sorry.  Have you checked with the documentation here?

SlavyanAuthor Commented:
You know I think it is a solution. There's Migration Manager in Plesk for both domains & accounts.
So, I'll read into it.
Slavyan -

Migration Manager, according to my quick read, was for migrating from a competing product (such as Cpanel)...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.