Our features site is undergoing a refresh! Be sure to explore the revamped site and discover our latest product roadmap launching here on Monday, March 18th.

Migrate IMAP mailbox to cPanel

Nathan Lierbo shared this idea 12 years ago
Open Discussion

Consider this scenario: a new hosting customer wants to migrate their mailboxes from their old host to cPanel. However they've either been using an IMAP client or they've been using webmail. They have many folders set up in their mailbox. How can they do the transfer? In short, cPanel offers no support at pres


There appear to be solutions on the web for migrating IMAP mailboxes so I know it's possible. Please implement this in cPanel so that customers can click 'Transfer my mailbox from a different provider' during the mailbox creation process.


I recently encountered this problem. Actually it's been an issue ever since I became a web host 10 years ago but in this instance it wasn't an option to say "You'll lose all but your inbox." In the end, what worked was for me to create two Outlook accounts, one to connect to my customer's old mailbox and one to connect to his new cPanel mailbox. I then had to download & transfer the mail folder-by-folder. In my case I only had to migrate 1 mailbox and the person had only a handful of folders with no nesting, so it was just about manageable. That said, it still wasted a lot of time.


FYI I looked online for solutions. They exist but:

a) they require installation of other software (e.g. Perl) before you can use them

b) they suffer from mail size limit - any message over about 7MB can't be transferred

c) they require payment - given that I've paid for cPanel I expect this kind of functionality to come as standard.


I've created this post on the recommendation of cPanel support staff following a support ticket I posted. It would be great to get this supported.


If you're a WHM/cPanel user and this has been a problem for you, please add a "Me Too" post. Your 'votes' will help escalate this request.


Finally, thanks to cPanel for an otherwise good product and awesome support.


Cheers,

Paul.


Original thread and comments can be reviewed at: http://forums.cpanel.net/f145/migrate-imap-mailbox-cpanel-250602.html

Replies (35)

photo
1

+1 for this feature :) (haven't had any votes left for over a month now :( )

photo
2

http://imapsync.lamiral.info would be a perfect tool for this, too bad there isnt something emplimented into the CP

photo
3

When I started using cpanel I had the same issue, I wound up having to use http://imapsync.lamiral.info


It worked great but I agree it would be nice if there was an option to have this tool built in with a gui of sorts.

photo
2

Absolutely agree.


Having a GUI tool in cPanel (or WHM) to handle a complete migration from another service (whether it be another Linux-based IMAP/POP3 server, Google Apps, Office 365 - anything that speaks IMAP/POP3) AND have it handle the migration in the background (along with either complete migration or selective folders) would be superb.


If the source service offers the ability to export email addresses and passwords in, say, CSV format which could be imported into cPanel as part of the migration, that would be handy too. Would save the cPanel or WHM administrator having to manually create email accounts and setting up passwords. Avoids errors too.

photo
3

This is actually why I host my client's emails on OpenSRS mail services. It adds a small amount to my hosting fees, but it has a really great power user tool where you can input a user's email address, password and click import. Those actually are bulk import tools so that you can actually import many accounts at the same time. It goes through all the trouble and the only thing you have to do next is to change the MX records of the domain to point to OpenSRS. It also has the advantage to distribute the server load of email receiving and sending (which can weirdly be a lot) and saving the disk space of that as well.


Having this built-in directly in WHM would make me consider not to use OpenSRS though. That's a big hassle that seems doable since some tools exist and since OpenSRS did it. I would even consider paying a whole new server with another installation of WHM only to host my emails if that tool existed!


If the two servers are CPanel based, they could even handshake over the API and work with that to make the transfer.

photo
2

I've been using imapsync for years, but it would be great to include a feature like this via cPanel for users to use and via WHM for mass import.


We have a server with SmarterMail that also has this option when the customer first logins at his e-mail account.


Horde Webmail had a feature called "Fetch Mail", but it seems to have been discontinued.

http://wiki.horde.org/FAQ/User/IMP?referrer=FAQ%%2FUser#toc23

photo
1

Would definitely be useful, if it could be done well. Particularly because of subfolders.

photo
2

This should be a top priority. Would save a lot of time and headaches.

photo
2

We currently do this manually for customers :


We tell our customers they have to provide us bot new and old passwords.

We install a debian VPS, apt-get install imapsync, add our config file and run the sync then delete the VPS.


A simple interface that only allows to sync external imap e-mail accounts to local e-mail accounts would mean we didn't have to do this ourselves manually and that we wouldn't need the customers new password.


E-mail users should be able to do this for their account from inside the Webmail interface.

cPanel users should be able to do this from their cPanel account

WHM root user and resellers should be able to do this without logging into the client's account.


The most important implemention for us would be in the cPanel user's account, the webmail and WHM implementation could come later if it helps speed up the release date.

photo
1

Me too

photo
1

If you have root access on both servers, you no need imapsync feature.

Just compact messages on old server, and extract it on new server.

If you extract it through cPanel File Manager, you need no change files permissions.

Keep in mind the MTA used. Migrate dovecot to dovecot (courier to courier) is simple. Migrate courier to dovecot (or dovecot to courier), you will need to check subscribe folders.


BUT, it's a nice idea!

photo
3

obviously if you have root access on both servers you dont need this feature... or even if you have cpanel access on both servers you dont need it since you can do a cpanel backup and restore.., it is for migrating from other non cpanel servers that is the iportant feature abuot this. Horde used to have the ability (fetch mail) and that was good, but they decided it wasnt a useful feature?? and removed it!

photo
3

Very usefull, especially as a hoster it would be nice to have this as a service. It lowers the bar to migrate to your hosting because a big worry of customers is loosing their email. If users can do this themselves OR we could do it for them as a service it would be awesome!

photo
1

I couldn't agree more, this would be very useful!

photo
6

+1 for http://imapsync.lamiral.info -- have been using this successfully for quite a while. Obviously I'd prefer to have something built into WHM to help with these migrations.

photo
1

I recently lose the oportunity to transfer in a customer with 580 email accounts, and all of them being worked via webmail. Having this feature within cPanel would be absolutely great!

photo
4

For that size of customer, why not setup a small debian vps and install imapcopy and then use it to copy the e-mails accross ? That's what we do while waiting for this feature to be accepted…

photo
1

Interesting information, I'm a very small sized provider and wasn't aware of that script. I definitely will try it and continue lurking this site and the forums cause you definitely can learn a lot every day :)


Thanks!

photo
1

because as a provider i would like to do it in one simple step if possible to avoid customer headache


if such scenario is available migrating my customers to cPanel would be a Dream:


1- from the cPanel account put a list of accounts with a common temp password on the source server for all accounts

2- Create the emails list with random passwords on the new cPanel account

3- Move all e-mails messages from old to the newly created mailbox

photo
4

Yeah, this is a real problem. I find this issue too.


cP team should implement something built in for this, maybe based on imapsync, however cP team should be very careful because I've seen a lot of different IMAP servers that deal with folders in very different ways. The folder hierarchy scheme is typically defined by a separator that can change from system to system, cP team should have this in consideration, otherwise migrations will fail.

photo
1

would be very good to have this feature as most clients are now using IMAP. an import function during email creation would be ideal.

photo
3

Yes. cPanel should definitely put some efforts on deploying this feature. Some days ago I had to transfer in an account with 380 email accounts weighing almost 30 GB from a server with such a bad connection than the backup process was unable to do a transfer, and the imapcopy script failed several times. Fortunately I found the free imapcopy service by OVH. Otherwise it would be an impossible task.


So, cPanel guys, please put this feature within the planned ones. We need this.

photo
1

I had the same situation. But not huge as yours. I had a server in singapore, so I used imapcopy from that server. Didn't know there was a free server on OVH. My destination server is at OVH.

photo
1

Hello,


Also email account backup and restore to be added to backup wizard as this is important same as mysql backup and restore, If single user lost email messages from single account then how to restore it without full cPanel account restore.


Email users should be able to backup their accounts and restore it any time from the webmail interface, I think this feature related to the subject here and sorry it others think it's not.


Regards.

photo
2

I have come across this in the past and have had to use tools like imapsync, but would really be easier if it was 'built in'.

photo
1

Even when using the built in transfer tool there can still be some e-mails ending up on the old server (bounce when using express?) and it would be great to have the option to copy these e-mails from the old server to the new one as well...so basically a re-sync of missing items.

photo
1

@Mark - You ask about "re-sync". That should already work: If you do the transfer *again* from a remote server to your new server, it only copies new or changed files over (it uses rsync). That should pickup the new emails that came in (if you are using maildir). If you are using mdbox, it would likely not work as well though.

photo
1

I didn't know you could do it again. I thought it would either block the transfer or delete the account on the new server or do something else horrible with the account.


So I guess e-mail that got deleted on the new server would copy over again...not great but doable.

Any MySQL databases would go back to its old state though if any changes were made on the new server, right? We could tell the users not to make any changes, but telling website visitors to not post or comment or place orders would probably kill that option.

So just a feature to copy e-mails over that arrived after the rsync started/completed would be better, I think.

photo
1

I've done it several times, for just that exact reason, to get new emails. It won't transfer at all the second time, unless you check the "overwrite" box, then it does an rsync and only copies changed files. So, the first transfer might take 20 minutes, then next transfer might take 1 minute.


And yes, like you said, it will recopy deleted emails, and the mysql data will revert backwards (and any other account changes you might have made on the new server)

photo
1

Interesting...so that helps during a longer move then. So I guess the first one would be a regular one and then an express move to hope that new e-mails will then follow. Something to think about. Thanks.

photo
1

This would be fantastic! Does anybody know if this is in the works?

photo
1

It's not currently, unfortunately. If it gets picked up and is being worked on, you'll be able to tell by the flag at the top of the page that currently reads "Open Discussion". Once work starts it moves to "In Progress".

photo
1

This would be great to see this feature added to Cpanel. It would help build more Cpanel usage and popularity making it easier for users to migrate from different hosting platforms. Voted!

photo
1

Would be great to have this feature added to CPanel.


Migrating mails can be a pain for Resellers and Shared Host.

photo
1

I haven't used it yet, but this command line utility is installed in my cPanel server (by default, I think):


http://wiki2.dovecot.org/Tools/Doveadm/Sync

photo
2

Holly cow! I'll study this utility. I'm currently using imapcopy for Windows (http://www.ardiehl.de/imapcopy/), which is a bit old and for unknown reasons won't be able to copy some emails, and syncs may have an embarrassing 90% of success, meaning 10% of emails may not be synced, which is odd, and too bad, but I haven't found anything better, until today. I bet that sync failures are due to some encoding issues because not copied emails are not spam nor are them malware; and given the imapcopy utility is abandonware since 2009, I simply can't blame it.


If Dovecot include such an utility, and it works, I would suggest cPanel team to create some kind of UI where you just fill the required data:


Source Mail Server: [FQDN or IP]

Source Port: [default to 143]


Destination Server: [FQDN or IP]

Destination Port: [default to 143]


And within imapcopy config, you have to fill something in this format


# SourceUser SourcePassword DestinationUser DestinationPassword


Copy "sales@somedomain.com" "C1sGt9HM8v" "sales@somedomain.com" "C1sGt9HM8v"


This feature is a must in all those scenarios when a hosting account must be transfered-in from a server not using cPanel.


As this is used by resellers and some end users as well, I'd also suggest this feature to be implemented within the account's cPanel, not at a WHM level.


As I use the buggy imapcopy almost in a daily basis to transfer new accounts from "bad panels" (LOL) I will gladly be happy to be a betatester for this.


Thanks!

photo
2

I use imapsync (https://imapsync.lamiral.info/). I don't know the differences between dovecotsync and imapsync though.

A more Integrated Tool accessible from WHM web would be nice though.

photo
3

Marcelo, you should put away ImapCopy and start using the command line imapsync. Works 100% of the time for me. I can even use it to move mail to/from GMail. Great support via a Mailman mailing list, if you get stuck. I have the install process for cPanel, as well as some good usage examples, well documented, but I'm not sure if it's appropriate to post here.


- Scott

photo
1

I'd love to see those examples get shared, but this should likely all be moved to either a forum thread or to a private email. Thanks!

photo
1

@Scott: Yes, I would be glad to start using something able to do this work better. Can you share a post in the forums with some examples? I will also thoroughly read the utility docs and google a bit to learn AMAIC.


I have to migrate 27 email accounts right now... :(

Thanks in advance!

photo
5

I've posted a tutorial on how to install and use IMAPSync to move IMAP mailboxes from server to server. See: https://forums.cpanel.net/threads/how-to-using-imapsync-to-transfer-mail-from-server-to-server.596231/


I'd love for cPanel to have such a tool available... but, until then, the imapsync command line tool is what we use to get the job done.


Hope this helps -- Scott

photo
1

Thanks a lot Scott. Last night I readed a lot about it and purchased a license and will test it today or tomorrow using the Windows exe with the file.txt bulk method :-)

photo
4

I think this is essential now. With IMAP being the standard format for mail, moving large accounts around is no fun at all. There are some very good services out there, but they cost money. Office365 and Gmail offer this to clients, meaning cPanel hosts are at a disadvantage. We bring a lot of new clients across, but the mail issue is becoming a real time consumer, especially when they have 30 gig mail boxes.

photo
2

I also think this is a must ( 4 years after this thread was opened apparently ).

There are two many bad panels out there , and in more than one case , this was the only reason why a client ( and also myself ) did not move to cPanel - the fear of losing mails that can not be directly accesses or on server without root ...

In my case , I can count at least 30 client domains that are not on cPanel / WHM just because of that exact reason - old mails and legacy mails , and the difficulty / fear to migrate them or loose them .

photo
2

As much as I want this done, not-moving email because you're afraid just means you don't know what you're doing. It's straightforward. It's just extremely time-consuming, and able to be automated with cPanel. I'm myself currently putting off a number of domains worth of email transfers just because I don't have time to deal with it at the moment.


Please give this a look, guys -- it would help a lot of us. Particularly with full support for creating/replicating existing folder structure from the old mailbox to the new mailbox.

photo
3

@brt - Yep . I don't know what I am doing, or I do not trust myself , Or I do not trust my employees, or my clients . Whatever the case may be - this is exactly the reason why Cpanel / WHM exists ( and why we love it ) , to make a simple-to-use fool-proof and battle-tested interface that facilitate all the tasks that otherwise can be done with direct CLi / SSH command . After all - Each and every of the tasks that Cpanel or WHM offers can be done manually . They are just time consuming , error-prone , and tedious . but never impossible - especially for CLI wizards and *nix expert like ( I imagine ) yourself .

photo
3

Gets my vote. It's not a complicated job but boy is it time consuming.

photo
1

As Ryno Van Wyk mentioned, I tried it myself. It'll be great to have such functionality directly from cPanel. It is pretty straightforward. They're using a Perl tools pop2imap (GPL License) to achieve it. pop2imap is a tool for facilitating incremental POP to IMAP transfers from one mailbox to another. It is useful for mailbox migration and reduces the amount of data transferred by only copying messages that are not present on both servers. The process can be stopped and resumed. The original messages can optionally be deleted after a successful transfer.

The same can be used by Cpanel : http://freshmeat.sourceforge.net/projects/pop2imap

It'll make life way easier when 100s of accounts need to be migrated from 3rd party mail provider to cPanel.

photo
9

We are currently looking into creating this feature. More to come soon!


Koree A. Smith

Product Owner

cPanel, LLC

Replies have been locked on this page!