Author Topic: How to migrate emails from cpanel to CWP  (Read 35634 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
How to migrate emails from cpanel to CWP
« on: June 08, 2018, 03:42:32 PM »
I know this question has been asked previously in this forum. I referred the topic http://wiki.centos-webpanel.com/how-to-manually-import-emails to manually import the email. But it did not work.

I believe the steps mentioned are not complete and does not clearly explain the purpose of steps. For example the step of running rsync command. When I ran the command, I got error in ssh panel as " No such file or directory". CWP support should mention that before running this command, one needs to create directory at target location.

Can someone on this forum please provide detailed exact steps to migrate ONLY emails from cPanel to CWP.

Also cPanel create mail folder at home directory of user but when I created email account from CWP, it created the mail folders in var folder. The account user will not have access to this var folder. And suppose my client wants to configure something at folder level for his emails, how would he get access to the email folders created in var folder.

I need urgent help on this. Kindly help.

Thanks

Offline
***
Re: How to migrate emails from cpanel to CWP
« Reply #1 on: June 09, 2018, 06:55:49 AM »
I give you a better solution, let's try.
What do you need?
-Microsoft Outlook or any email client
-Your email must be an IMAP account

The idea : sync your emails via email client (IMAP account)

- First, dont touch your current email (I call it email email_A@domain.com hosted at your old mail server IP_1)
- Go to CWP, add your domain, create new email account, of course you will have the inbox email_A@domain.com (exactly the same email address, but hosted at your new server IP_2 )
- Now you launch Outlook, add your new email but instead of input your mail.domain.com (mail server address, it might be different base on your configuration), you input your new IP (IP_2)
- drag all emails and folders from email_1 to email_2 (maybe drag 1 email for a test)
- Wait for the email to be synced to new server (actually it just upload)
- Go to roundcube on the new server, verify it
- If everything looks good, you can continue to sync and disconnect your old account in Outlook




Offline
*
Re: How to migrate emails from cpanel to CWP
« Reply #2 on: June 09, 2018, 12:57:33 PM »
Thanks @locvfx for this suggestion.
Although your solution may be time consuming in case of large email box sizes but it sounds interesting!

I will try to explore it out definitely along with some other options.

But one suggestion for CWP Support! I believe, this must be a very common and indispensable requirement for any user who is coming from cPanel paradigm. The support should at least provide a well documented and really detailed instruction with snapshots on how to do manual email migration. Feel quite disappointed as I am using Pro version of CWP.

Thanks for your tip.

Offline
*****
Re: How to migrate emails from cpanel to CWP
« Reply #3 on: June 09, 2018, 06:27:44 PM »
Why not use the migration module from cpanel and just check the email option

Offline
*
Re: How to migrate emails from cpanel to CWP
« Reply #4 on: September 11, 2019, 04:04:49 PM »
The idea : sync your emails via email client (IMAP account)

- First, dont touch your current email (I call it email email_A@domain.com hosted at your old mail server IP_1)
- Go to CWP, add your domain, create new email account, of course you will have the inbox email_A@domain.com (exactly the same email address, but hosted at your new server IP_2 )
- Now you launch Outlook, add your new email but instead of input your mail.domain.com (mail server address, it might be different base on your configuration), you input your new IP (IP_2)
- drag all emails and folders from email_1 to email_2 (maybe drag 1 email for a test)
- Wait for the email to be synced to new server (actually it just upload)
- Go to roundcube on the new server, verify it
- If everything looks good, you can continue to sync and disconnect your old account in Outlook

Just wanted to thank you for the idea of this workaround. Personally I'm migrating from Direct Admin and used your IMAP idea to move all the emails.

Thanks!

Offline
*
Re: How to migrate emails from cpanel to CWP
« Reply #5 on: January 25, 2020, 12:10:48 AM »
Why not use the migration module from cpanel and just check the email option

Hi Sr. I already use the migration tool to copy accounts from cpanel to cwp. everything works fine except by the email that I can open in roundcube.

I create a new account in cwp to test and create new email and already sent a email after this, I check in console the content of the email and it is plain text so I can read it; but when i do the same to the imported email from cpanel they are like binary files unredeable.

Any solu

Offline
*
Re: How to migrate emails from cpanel to CWP
« Reply #6 on: January 25, 2020, 06:47:14 AM »
1. Create email account in CWP cpanel or from WHM level
2. Login ones to email with roundcube so the email folders will be created by dovecot
3. rsync emails from cpanel to cwp. In cwp mail are located at /var/vmail/domain/local_part
4. After rsync change ovner of email folder with:  chown -R vmail.mail /var/vmail/domain/local_part

Re: How to migrate emails from cpanel to CWP
« Reply #7 on: January 25, 2020, 10:25:35 AM »
LMFTFY
1. Create email account in CWP cpanel or from WHM level
2. Login once to email with roundcube so the email folders will be created by dovecot
3. rsync emails from cpanel to cwp. In cwp mail are located at /var/vmail/domain/local_part
4. After rsync change owner of email folder with:  chown -R vmail.mail /var/vmail/domain/local_part

IMO, the location of user emails is fundamentally wrong in CWP. User files should all be stored within the users' own directory.
Note: mysql is also non-compliant (not a CWP issue) in that it stores user databases in /var/lib/mysql

Offline
***
Re: How to migrate emails from cpanel to CWP
« Reply #8 on: January 26, 2020, 03:06:56 PM »
LMFTFY
1. Create email account in CWP cpanel or from WHM level
2. Login once to email with roundcube so the email folders will be created by dovecot
3. rsync emails from cpanel to cwp. In cwp mail are located at /var/vmail/domain/local_part
4. After rsync change owner of email folder with:  chown -R vmail.mail /var/vmail/domain/local_part

IMO, the location of user emails is fundamentally wrong in CWP. User files should all be stored within the users' own directory.
Note: mysql is also non-compliant (not a CWP issue) in that it stores user databases in /var/lib/mysql

Agreed. Emails should be stored within user's own directory like in cPanel.

Offline
*
Re: How to migrate emails from cpanel to CWP
« Reply #9 on: February 01, 2020, 10:56:37 AM »
Hi,
IMPORTANT: cPanel to CWP  dont work with emails account configured as MDBOX. Now only MailDir works.
So first you need to check and convert all accounts to maildir prior to transferring account to CWP.

Than You need to manualy change passwords for account as script dont do this. If You use script to convert cPanel server to CWP in 1st step you get proper values for email password - ready to be paste to database.

Additionally - I think the way emails are stored is positive as You can mount different server for /var/vmail
« Last Edit: February 01, 2020, 10:58:54 AM by PiotrE »

Offline
*
Re: How to migrate emails from cpanel to CWP
« Reply #10 on: February 22, 2020, 06:46:50 PM »
An update-  emails also cant be in an compressed form. Have to be uncompressed. In cPaenl You need to convert them to maildir but before check if You have email compression turn off in mailserver settings.

Offline
*****
Convert MDBOX e-mail before migration
« Reply #11 on: May 13, 2020, 10:10:43 PM »
That would seem to be key info -- make sure you convert MDBOX format e-mail to Maildir before attempting a cPanel backup for account move or the cPanel Server Migration to CWP routine.

After my failed migration attempt, I do not have working e-mail accounts showing, but I do have 30GB of e-mail files. It does look as though the permissions are screwy, so I ran this in a vain attempt to get the mail to show in the CWP User side:
Code: [Select]
chown -R vmail.mail /var/vmail
find /var/vmail -type f -exec chmod 644 {} \;
find /var/vmail -type f -exec chmod 644 {} \;

Offline
*****
Re: How to migrate emails from cpanel to CWP
« Reply #12 on: May 19, 2020, 09:55:19 AM »
emails also cant be in an compressed form. Have to be uncompressed. In cPaenl You need to convert them to maildir but before check if You have email compression turn off in mailserver settings.
BINGO! Can't highlight that information enough. On the cPanel Server, go to Mailserver Configuration and make sure that Compress Messages is off. I had converted Mdbox to Maildir before trying to import, but afterward everything was messed up (even though message stores were the right size). So I went back and looked at the cPanel server. Turned off Compress Messages, then had to convert BACK to Mdbox and then BACK AGAIN to Maildir. Then the Migration / rsync mail messages works as expected. (Well, then some permissions clean up).