Get Paid to Participate - up to $1 per post!     Twitter     Facebook     Google+
Hosting Discussion
 

Hosting Discussion > Web Hosting Forums > Web Hosting Discussion > How to migrate mails from cpanel to cpanel on different servers ?
forgot password?



Reply


Old
  Post #1 (permalink)   05-06-2016, 12:01 AM
HD Newbie
 
Join Date: May 2016
Posts: 20

Status: YoYoC is offline
Hi,
I have the same email account on different cpanel servers.
When I copy content of mail/domain.com to A new server, it works well.
But since I have mails in both servers, I get "file already exist" notification. I tried to "skipping" existing files, but this time the migration failed. I was afraid to overwrite existing files, thinking I may lose mails in the destination server.
So what should I resolve this problem?
All advice would be appreciated.
 
 


Old
  Post #2 (permalink)   05-06-2016, 03:44 AM
HD Community Advisor
 
ughosting's Avatar
 
Join Date: Jan 2011
Location: London
Posts: 608

Status: ughosting is offline
You are correct in your assumption. In theory, if you merge the files skipping the ones that are duplicate you have done the right thing.

Just ensure that the permissions on the files are correct when you have finished. As if the accounts have the same name, but different user numbers in /etc/passwd a tar file, for example, will have made the files the wrong owners when you "untarred" the file.

Otherwise, OVH.com have a really good imap to imap move utility
__________________
DDoS Protected, LiteSpeed + LiteMage on CloudLinux with SSD Disks, R1Soft, Softaculous, SIteBuilder, BitNinja, LetsEncypt & Patchman
UnixGuru: Accounts with 1-16 CPU Cores, 2-32GB RAM. Why use a VPS?
█ Choose from Shared, Reseller and Elastic-Sites Hosting

Last edited by ughosting : 05-06-2016 at 03:46 AM.
 
 
 


Old
  Post #3 (permalink)   05-06-2016, 05:03 AM
HD Newbie
 
Join Date: Apr 2016
Posts: 18

Status: jakeh is offline
I would recommend you to get in touch with your host as they will be better able to assist you with this.
__________________
InnoHosting, Performance Web Hosting ||
Web Hosting - Virtual Servers - Managed Servers - Application Hosting
Reseller Hosting with WHMCS & Preloaded KB | SSL | activGuard | End User Support
 
 
 


Old
  Post #4 (permalink)   05-06-2016, 04:10 PM
HD Master
 
whmcsguru's Avatar
 
Join Date: May 2016
Posts: 285
Send a message via Skype™ to whmcsguru

Status: whmcsguru is offline
It's actually not terribly hard to do this, and I've done it before for clients. Here's how to do this

#1: Enable SSH (this is important) for the account on the new server
#2: Setup ssh keys and establish the key on the new server
#3: use something like the following rsync command, as a cron job

Code:
rsync -azv -e"ssh -pport"  ~/mail/ newserver:/home/user/mail/
This will effectively sync over mail from the old to the new server as frequently as you have the cron run. I typically run it every 10-15 minutes for the first few days after accounts are transferred.
 
 


Old
  Post #5 (permalink)   05-07-2016, 02:11 PM
HD Newbie
 
Join Date: Apr 2016
Location: kochi
Posts: 17

Status: Eric Thomas is offline
You can easily migrate mails from one cPanel account(cPanel A) to another cPanel (cPanel B) account by simply creating the email address manually via cPanel and once this done you can remove the mail directory on /home/user from cPanel (cPanel B) and copy the mail directory from the cPanel (cPanel A) to it and update ownership to make the mails working .
 
 
 


Old
  Post #6 (permalink)   05-07-2016, 04:40 PM
HD Master
 
whmcsguru's Avatar
 
Join Date: May 2016
Posts: 285
Send a message via Skype™ to whmcsguru

Status: whmcsguru is offline
^^ actually no. That's not a good idea
The reason that's not a good idea? DNS

If you're moving accounts from server A to server B, you need to leave email intact for both servers. Don't delete any accounts, or any mail. The best and safest approach is the rsync method used above (and not just because I mentioned it).

If you delete the accounts, or the directories prematurely, bad things can and will happen. Clients will get upset because their clients couldn't mail them (rather it went to the wrong server), etc.
__________________
WHMCS Guru - WHMCS addons, management, support and more.
WHMCS Notifications Extended - Add slack, hipchat, SMS, pushover to your WHMCS install!
WHMCS User and IP Extended Control - Take control of your WHMCS install
Linux admin, WHMCS Guru for hire. PM me for more information
 
 


Old
  Post #7 (permalink)   05-08-2016, 12:24 AM
HD Community Advisor
 
ughosting's Avatar
 
Join Date: Jan 2011
Location: London
Posts: 608

Status: ughosting is offline
DNS Issues

How long it takes to move your domain can be changed.

1. Look at you DNS settings and see what your TTL (time to live) is.

This is how long an ISP or client can cache the answer for a DNS lookup from your domain. (In this case an A or MX record lookup).

14400 = 4 Hours. change 8 hours before the move
...
86400 = 24 Hours, change 48 hours before the move

Change this to something like 300 (5 minutes).

If you do this long in advance like 48 hours, then when you are ready to move it should only take 10 minutes (twice the TTL) for DNS to completely move.

Email
Rsync is a good method to do this, but as long as the files end up with the necessary permissions this shouldn't matter.
__________________
DDoS Protected, LiteSpeed + LiteMage on CloudLinux with SSD Disks, R1Soft, Softaculous, SIteBuilder, BitNinja, LetsEncypt & Patchman
UnixGuru: Accounts with 1-16 CPU Cores, 2-32GB RAM. Why use a VPS?
█ Choose from Shared, Reseller and Elastic-Sites Hosting
 
 
 
The Following User Says Thank You to ughosting For This Useful Post:
Artashes (05-12-2016)


Old
  Post #8 (permalink)   05-08-2016, 10:32 AM
HD Master
 
whmcsguru's Avatar
 
Join Date: May 2016
Posts: 285
Send a message via Skype™ to whmcsguru

Status: whmcsguru is offline
In theory, yes. However, believe it or not, even with those values (and they're pretty standard, have been for years), there are still those that don't follow that practice. I've seen this time and time again, where DNS has been changed (or left as is, since it was default), and even days later the mail still goes to the old server.
__________________
WHMCS Guru - WHMCS addons, management, support and more.
WHMCS Notifications Extended - Add slack, hipchat, SMS, pushover to your WHMCS install!
WHMCS User and IP Extended Control - Take control of your WHMCS install
Linux admin, WHMCS Guru for hire. PM me for more information
 
 
 


Old
  Post #9 (permalink)   05-12-2016, 03:02 AM
HD Newbie
 
Join Date: May 2016
Posts: 20

Status: YoYoC is offline
Thank you for your opinion. It's helpful.
 
 
 


Old
  Post #10 (permalink)   05-12-2016, 04:02 AM
HD Guru
 
Join Date: Jan 2013
Posts: 756
Send a message via AIM to cheapdedicated Send a message via Yahoo to cheapdedicated Send a message via Skype™ to cheapdedicated

Status: cheapdedicated is offline
Set up a job for rsync -azv -e"ssh -pport" ~/mail/ newserver:/home/user/mail/ should be able to sync
__________________
Techsys Ltd | Dedicated Servers | V.P.S | Free Plesk Panel
G8 Servers cPanel Reseller VPS Reseller Dedicated Server Resellers

G8 Host Cheap Domains | Shared Hosting | SSL
 
 
 


Old
  Post #11 (permalink)   06-24-2016, 03:28 AM
HD Master
 
Join Date: Sep 2014
Location: India
Posts: 272
Send a message via Skype™ to 24x7server

Status: 24x7server is offline
You can use 'imapsync ' command to migrate the emails from one cPanel server to another.

Following is the command -

imapsync --host1 server1.example.com (source) --user1 Your email address --password1 (password on server1) --host2 server2.example.com (target) --user2 Your email address --password2 (password on server2)
__________________
www.24x7servermanagement.com
Server Management, Server Security, Server Monitoring.
Network Monitoring Team !! Skype: techs24x7
 
 


Old
  Post #12 (permalink)   06-24-2016, 11:14 PM
HD Addict
 
Join Date: Nov 2008
Location: Central Indiana, USA
Posts: 213
Send a message via AIM to MikeDVB Send a message via MSN to MikeDVB Send a message via Skype™ to MikeDVB

Status: MikeDVB is offline
imapsync is nice if it works - I've never had luck with it working for some reason.

I usually just add both email accounts to my mail client as IMAP and then drag and drop the messages over. That said - the last time I had to do this was several years ago.
__________________
Michael Denney - MDDHosting LLC - Professional Hosting Solutions
Cloud Shared Plans Check them out! Old plans still available.
Shared, Premium, Reseller, and VPS
http://www.mddhosting.com/
 
 


Old
  Post #13 (permalink)   06-25-2016, 12:24 AM
HD Amateur
 
Join Date: Jan 2015
Location: Kakkanad
Posts: 72

Status: nixtree is offline
If both are cpanel , then rsync will be the best option as we can simply copy paste the passwd and shadow files as well if needed.

If you are moving mails from cpanel to non cpanel or vice versa then imapsync is the best and proper tool which I have seen for migrating mails . The only issues with imapsync is we need to have password for all email accounts in both source and destination server.
 
 


Old
  Post #14 (permalink)   07-28-2016, 02:49 PM
Account Disabled
 
Join Date: Jul 2016
Posts: 1

Status: UniqueStarHost is offline
Hi,

it can be easily migrated from server root (whm) access, follow the below steps.

1- Login to WHM
2- search "copy an account from the other server"
3- put another server ip, user, and password.
4- Click copy account.

Last edited by Artashes : 07-28-2016 at 03:12 PM. Reason: Signatures must be setup through control panel
 
 
 


Old
  Post #15 (permalink)   07-29-2016, 03:04 PM
HD Master
 
whmcsguru's Avatar
 
Join Date: May 2016
Posts: 285
Send a message via Skype™ to whmcsguru

Status: whmcsguru is offline
Except this doesn't do what the OP asked. That won't keep mail up to date.
__________________
WHMCS Guru - WHMCS addons, management, support and more.
WHMCS Notifications Extended - Add slack, hipchat, SMS, pushover to your WHMCS install!
WHMCS User and IP Extended Control - Take control of your WHMCS install
Linux admin, WHMCS Guru for hire. PM me for more information
 
 
 
Reply
Previous Thread Next Thread


Thread Tools

New Post New Post   Old Post Old Post
Posting Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Sponsored By: