Email Migration - Different setups on each hosting platform

Rich Banton

Registered
Jun 7, 2019
2
0
1
Dartford
cPanel Access Level
Root Administrator
I have been tasked by a client to move there emails across from there old hosting to there server.

I understood this to be simple, create the accounts on the new server, move the mail and etc folder via ftp from one server to the other then update the maildirsize file. That seemed simple enough.

When I looked into moving the folders on the old server the file structure is different from the new server.

E.g.
Old Server format \mail\addon domain\user\ this contains folders for drafts junk etc

New Server format \mail\addon domain\user\ this contains 2 folders mailboxes & storage and a lot less dovecot files

I though maybe it was due to different cpanel versions but here are the specs

Old Server

Hosted on site5
cPanel Version 70.0 (build 69)
Apache Version 2.4.39
PHP Version 7.0.33
MySQL Version 5.6.32-78.1
Architecture x86_64
Operating System linux

New Server

Hosted on A2
cPanel Version 70.0 (build 69)
Apache Version 2.4.39
PHP Version 7.2.18
MySQL Version 10.2.23-MariaDB-cll-lve
Architecture x86_64
Operating System linux

Now the client doesn't want to give me the email account passwords as they want to keep the email's confidential, so how do I get the email accounts across with the same passwords and all the mail as it is on the old server?

I'm fairly new to cpanel, but I'm proficient in domain records etc, so this is a little out of my comfort zone. Thank you in advance for you help.
 

Attachments

mtindor

Well-Known Member
Sep 14, 2004
1,361
64
178
inside a catfish
cPanel Access Level
Root Administrator
The old server is using Maildir. The new mailserver is using MDBox.

Unless you have administrative access on one/both servers, you might not be able to convert.

Mailbox Conversion - Version 78 Documentation - cPanel Documentation

You probably either need to ask the old host to convert all the mailboxes to MDBox before you migrate, or ask the new host to convert that hosting account to using Maildir before you migrate.

Otherwise, the client is going to have to give you the passwords (or you will set temporary ones and they will have to log in and change them back to what they want) and then you would use IMAPSync or something like that to pull there mail over from the old server to the new server.

Mike
 

mtindor

Well-Known Member
Sep 14, 2004
1,361
64
178
inside a catfish
cPanel Access Level
Root Administrator
And, assuming you would be able to do things the way you originally planned, you are still going to have issues.

Why don't you make a backup using hte backup wizard on the old machine, download the tar.gz file, and ask the new host to import the hosting account from scratch using the backup you've provided them. That should restore the whole hosting account onto a new server without issues.

mike
 

Rich Banton

Registered
Jun 7, 2019
2
0
1
Dartford
cPanel Access Level
Root Administrator
If i was able to get the old host to convert the mailboxes to MBOX, neither hosting company are being particularly helpful, what issues would I run into moving the MBox Folders across?
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,910
2,233
363
cPanel Access Level
DataCenter Provider
Twitter
Hello @Rich Banton,

The following steps should help:

1. Backup the shadow and passwd files on the source server using commands like this:

Code:
cp -a /home/username/etc/domain.tld/shadow /home/username/etc/domain.tld/shadow.backup1
cp -a /home/username/etc/domain.tld/passwd /home/username/etc/domain.tld/passwd.backup1
Replace "username" with the cPanel username of the account that owns the email addresses, and replace "domain.tld" with the domain name associated with the email accounts.

This creates a backup of each email account's current username and password.

2. Change the passwords for each email account on the source server, and ensure you securely store a copy of the new passwords for use in the next step.

3. Install a third-party application on the destination sever like the one below to copy the email to the destination server:

cPanel App Catalog :: EmailSync - Platform independent ( remote ) mail migration

Alternatively, use the IMAPSync instructions on this thread.

4. Backup the shadow and passwd files on the destination server using commands like this:

Code:
cp -a /home/username/etc/domain.tld/shadow /home/username/etc/domain.tld/shadow.backup1
cp -a /home/username/etc/domain.tld/passwd /home/username/etc/domain.tld/passwd.backup1
Replace "username" with the cPanel username of the account that owns the email addresses, and replace "domain.tld" with the domain name associated with the email accounts.

5. Open /home/username/etc/domain.tld/shadow and /home/username/etc/domain.tld/passwd on the destination server using your preferred command-line text editor and replace the contents of these files to match how each looks on source server's backup copies (from step 1). This will ensure the original passwords work on the destination server.

6. Open /home/username/etc/domain.tld/shadow and /home/username/etc/domain.tld/passwd on the source server using your preferred command-line text editor and replace the contents of these files to match how each looks on the backup copies (from step 1). This will ensure the original passwords work on the source server as well.

Let me know if this helps.

Thank you.