Migrate mails between domains on same cPanel Account?

MBM92

Registered
Sep 27, 2019
1
0
0
Lima
cPanel Access Level
Website Owner
Hi guys, I'm new here.

This is my first time doing this.

I have a shared hosting where I host 2 domains of mine.

I want to transfer 3 mailboxes from domain1 to domain2, the mailboxes's sizes is in GB.

I was looking for a good way to migrate the mails, but I didn't find it.

I've been trying FileZilla, but I don't know what files do I need to download.

Could you please help me?

Thank you so much
 

cPRex

Active Member
Staff member
Oct 19, 2014
34
3
83
cPanel Access Level
Root Administrator
Hey there, @MBM92!

Welcome to the forums, and to cPanel. While there isn't a specific function within the cPanel product to perform this work, the following steps should let you do this manually. I would recommend using the "rsync" command over SSH as that will ensure directories get properly copied, where as a copy command could accidentally omit directories, or give errors if the directory already exists.

In this example we'll use the username "source" to refer to the old account we are moving the emails from, and "destination" to refer to the new account we are transferring data to.

1 - Create the email accounts you need on the destination cPanel account. This will also create the files in the cPanel configuration and the directories you need to copy the files to.
2 - Copy the files from the source account to the destination account. The directories will look something like this:

/home/source/mail/sourcedomain.com/emailuser
/home/destination/mail/destination.com/emailuser

For example, if you were using the rsync command on the server's command line, that would look something like this:

rsync -avh /home/source/mail/sourcedomain.com/emailuser/* /home/destination/mail/destination.com/emailuser/

3 - Change the ownership of the mail files so they match the destination owner. Since all those files we just rsync'd will be owned by the "source" user, we'll want to change that so they are owned by the "destination" user. The following command would make that change:

chown -Rf destination:destination /home/destination/mail/destination.com/emailuser

At this point I would expect the emails to show up properly under their respective accounts.

I hope this information has been helpful but let us know if you have any other questions!