Migrate from cPanel/Plesk to Zimbra Collaboration 8.0.x or 8.x

Migrate from cPanel/Plesk to Zimbra Collaboration 8.0.x 8.x

   KB 22379        Last updated on 10/2/2015  




0.00
(0 votes)


Purpose

Technical Process to migrate from cPanel to Zimbra Collaboration using the zmztomig Tool.

Resolution

Migrate from cPanel/Plesk to Zimbra Collaboration 8.0.x 8.x

cPanel or Plesk are the typical Hosting Software products, a lot of people use it for hosting Web Pages, Mail accounts, FTP, etc. But the email functionalities in this software are very limited, so the best option is split the services, let the Web Page in a cPanel or Plesk service, but put the email in a Zimbra Collaboration Server. In this Wiki we will see how to import all the cPanel/Plesk accounts trough IMAP protocol using the Account Migration tool that Zimbra include (Open Source and Network Edition)

Export the cPanel account list

>>Firebug needed. The first step is obtain a complete list of the users that we want to import into our Zimbra Collaboration server. cPanel doesn't have any easy way to export all the email accounts, and neither the email account with password, so we can select all of them and then copy/paste in a excel or follow these steps: Login into our cPanel account and go to the Mail section and click into Email accounts

Zimbra-imap-cpanel-004.PNG

Click into the right section and select 100 results, if we have more accounts, we need to repeat the next steps.

Zimbra-imap-cpanel-005.PNG

Open Firebug in the website and go into Console>Show command editor, and paste the next code in the right window, and press run.

Zimbra-imap-cpanel-006.PNG

   var rows = $("#table_email_accts tr.dt_info_row"),
   returnString = "";
   rows.each(function(i, item){
   var tdList = [];
   $(item).find('td:eq(0)').each(function(s, subItem){
   tdList.push($(subItem).text());
   });
   returnString += tdList + "\n";
   });
   console.log(returnString);

We will obtain in plain-text all the email accounts in the left window, and we can copy paste into a notepad, we will use it later.

Creating the 2 main XML files

The Account Migration tool works perfect in Bulk if we prepare well two differents XML.

  • The first xml is for the Account provision
  • The second xml is for the IMAP data import

Account provision XML

The following example shows an XML file that is used to provision multiple email accounts without importing mail, we will use the email accounts list that we exported before:

<?xml version="1.0" encoding="UTF-8"?>
<ZCSImport>
<ImportUsers>
<User>
<sn>Sample</sn>
<givenName>Sam</givenName>
<displayName>Sam Sample</displayName>
<RemoteEmailAddress>ssample@example.com</RemoteEmailAddress>
<password>test123</password>
<zimbraPasswordMustChange>TRUE</zimbraPasswordMustChange>
</User>
<User>
<sn>Zackry</sn>
<givenName>Zak</givenName>
<displayName>Zak Zackry</displayName>
<RemoteEmailAddress>zzackry@example.com</RemoteEmailAddress>
<password>test123</password>
<zimbraPasswordMustChange>TRUE</zimbraPasswordMustChange>
</User>
</ImportUsers>
</ZCSImport>

In this Wiki example, the name of the account provision xml file is cPanel-IMAP-users.xml

IMAP data import xml

The second xml is the one that will include the information about the old IMAP server, so we need to take careful and introduce all the usernames and passwords correctly. The following example shows an XML file that is used to import email for one account via IMAP from a gmail account without provisioning the email account in ZCS. The account must be provisioned on ZCS before running this type of XML file.

<?xml version="1.0" encoding="UTF-8"?>
<ZCSImport>
<IMAPHost>imap.gmail.com</IMAPHost>
<IMAPPort>143</IMAPPort>
<ConnectionType>cleartext</ConnectionType>
<UseAdminLogin>0</UseAdminLogin>
<ImportUsers>
<User>
<sn>Sample</sn>
<givenName>Sam</givenName>
<displayName>Sam Sample</displayName>
<RemoteEmailAddress>sam@example.com</RemoteEmailAddress><RemoteIMAPLogin>sam@example.com</RemoteIMAPLogin><remoteIMAPPassword>test123</remoteIMAPPassword>
</User>
<User>
<sn>Zackry</sn>
<givenName>Zak</givenName>
<displayName>Zak Zackry</displayName>
<RemoteEmailAddress>zzackry@example.com</RemoteEmailAddress><RemoteIMAPLogin>sam@example.com</RemoteIMAPLogin><remoteIMAPPassword>test123</remoteIMAPPassword>
</User>
</ImportUsers>
</ZCSImport>

In this Wiki example, the name of the account provision xml file is cPanel-IMAP-users3.xml

The Zimbra Account Migration Tool

Once we have everything prepared, and the xml correctly prepare, is time to use the Tool, in Admin Console, go Home>Tools and Migration>Account Migration

Zimbra-imap-cpanel-001.PNG

Click in the right corner and select the user Migration Tool, will starts the Wizard that we will use, select Generic IMAP Server, and both options; Provisionin accounts and Importing Mailboxes

Zimbra-imap-cpanel-002.PNG

In the next step, we will select the option Import from a XML file (use the first XML)

Zimbra-imap-cpanel-003.PNG

Zimbra-imap-cpanel-007.PNG

The wizard will detect all the accounts that we wrote in the XML file and will show a resume

Zimbra-imap-cpanel-008.PNG

Once the wizard provisioned all the accounts, we will see the result status

Zimbra-imap-cpanel-009.PNG

Now is time to import all the IMAP data in our new accounts, select now the second XML file

Zimbra-imap-cpanel-010.PNG

In this step we need to select the proper type of connction of our old IMAP server, clear text is the 143 default port without SSL.

Zimbra-imap-cpanel-011.PNG

So, we need to select the proper type hostname and port of our old IMAP Server

Zimbra-imap-cpanel-012.PNG

The wizard will show us a resume of the options that we've selected, press Next for start

Zimbra-imap-cpanel-013.PNG

And the process will start

Zimbra-imap-cpanel-014.PNG

If we go to console, we can check the status in the log /opt/zimbra/log/mailbox.log

   zimbra@zimbralab01:/root$ tail -f /opt/zimbra/log/mailbox.log
2014-10-25 21:48:35,785 INFO  [Thread-95] [] mailop - Adding Message: id=2552, Message-ID=<2a3cdaedd0c833@email.com>, parentId=-1, folderId=257, folderName=Trash.
2014-10-25 21:48:35,799 INFO  [Thread-95] [] mailop - Adding Message: id=2553, Message-ID=<ea211c82528531@email.com>, parentId=-1, folderId=257, folderName=Trash.
2014-10-25 21:48:35,819 INFO  [Thread-95] [] mailop - Adding Message: id=2554, Message-ID=<4f59d8aed0d9b95f@email.com>, parentId=-1, folderId=257, folderName=Trash.
2014-10-25 21:48:35,882 INFO  [Thread-95] [] mailop - Adding Message: id=2555, Message-ID=<b40b586d720c4a4e.squirrel@email.com>, parentId=-1, folderId=257, folderName=Trash.
2014-10-25 21:48:35,896 INFO  [Thread-95] [] mailop - Adding Message: id=2556, Message-ID=<6f5de1286203fcf10@email.com>, parentId=-1, folderId=257, folderName=Trash.
2014-10-25 21:48:35,915 INFO  [Thread-95] [] mailop - Adding Message: id=2557, Message-ID=<fa77cfe13ab00774@email.com>, parentId=-1, folderId=257, folderName=Trash.
2014-10-25 21:48:36,000 INFO  [Thread-95] [] mailop - Adding Message: id=2558, Message-ID=<b40b586d720c4a4e.squirrel@email.com>, parentId=-1, folderId=258, folderName=Sent.
2014-10-25 21:48:36,037 INFO  [Thread-95] [] datasource - Import completed for data source '__imap_import__'

In the Admin Console we can also see the status of the process

Zimbra-imap-cpanel-016.PNG

And once all account was imported, we can just login into our account and see all the imported emails, and folders.

Zimbra-imap-cpanel-017.png

Note We need to review the log for check what email or emails was fail during the import process.


Additional Content

  • No additional Content
Verified Against: Zimbra Collaboration 8.6, 8.5, 8.0 Date Created: 01/1/2015
Article ID: https://wiki.zimbra.com/index.php?title=Migrate_from_cPanel/Plesk_to_Zimbra_Collaboration_8.0.x_or_8.x Date Modified: 10/2/2015



Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »


Wiki/KB reviewed by Jorge SME2 Copyeditor Last edit by Jorge de la Cruz
Jump to: navigation, search