[Last Call] Learn how to a build a cloud-first strategyRegister Now


Migrating Mail Accounts

Posted on 2005-04-05
Medium Priority
Last Modified: 2010-03-04

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.
Question by:Slavyan
  • 3
  • 3
LVL 38

Assisted Solution

yuzh earned 600 total points
ID: 13714139
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
LVL 15

Accepted Solution

periwinkle earned 900 total points
ID: 13717029
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.


Author Comment

ID: 13719236
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.
Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.


Author Comment

ID: 13720115
To both Yuzh & Periwinkle:

Guys, can I solve this problem by using Plesk?
LVL 15

Expert Comment

ID: 13720311
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?


Author Comment

ID: 13720514
You know I think it is a solution. There's Migration Manager in Plesk for both domains & accounts.
So, I'll read into it.
LVL 15

Expert Comment

ID: 13720604
Slavyan -

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

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses
Course of the Month18 days, 14 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question