{"id":4476,"date":"2017-11-02T18:53:35","date_gmt":"2017-11-02T18:53:35","guid":{"rendered":"https:\/\/www.kevinmaschke.com\/?p=4476"},"modified":"2018-02-19T18:11:45","modified_gmt":"2018-02-19T18:11:45","slug":"migrate-kerio-zimbra-imapsync","status":"publish","type":"post","link":"https:\/\/www.kevinmaschke.com\/en\/migrate-kerio-zimbra-imapsync\/","title":{"rendered":"Migrate accounts from Kerio Connect to Zimbra Collaboration with ImapSync"},"content":{"rendered":"<p style=\"text-align: justify;\">In previous posts we saw <a href=\"https:\/\/www.kevinmaschke.com\/en\/linux-en\/zimbra-collaboration-8-6\/\">what Zimbra Collaboration is<\/a>, which <a href=\"https:\/\/www.kevinmaschke.com\/en\/linux-en\/zimbra-collaboration-8-6-prerequisites\/\">prerequisites are necessary for its installation<\/a>, how to <a href=\"https:\/\/www.kevinmaschke.com\/en\/linux-en\/zimbra-collaboration-8-6-dnsmasq\/\">install and configure DNSMasq<\/a> and finally, how to <a href=\"https:\/\/www.kevinmaschke.com\/en\/linux-en\/zimbra-collaboration-8-6-installation\/\">install Zimbra<\/a>.<\/p>\n<p style=\"text-align: justify;\">Now we&#8217;re going to see <strong>how to migrate our accounts from a Kerio Connect server to a Zimbra Collaboration server<\/strong>, since this was my case. To do this, we will use a <strong>free product called <a href=\"http:\/\/imapsync.lamiral.info\/\" target=\"_blank\" rel=\"noopener\">ImapSync<\/a><\/strong>. There is other software that can be used for this migration, some even based on ImapSync, but I tried a few, some with a graphical interface and some through the command line, and none did end up working correctly or as I needed between these two servers. Maybe it was me just doing something wrong, but with ImapSync I was able to achieve the results I needed.<\/p>\n<h2>Some considerations<\/h2>\n<h3>PLAIN Authentication<\/h3>\n<p style=\"text-align: justify;\">First, <strong>ImapSync requires PLAIN authentication to be enabled in Zimbra<\/strong>. This can be done in\u00a0<code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">Configuration &gt; General Configuration &gt; Proxy &gt; Proxy Congiguration for mail<\/code><\/p>\n<p><a href=\"https:\/\/cdn.kevinmaschke.com\/wp-content\/uploads\/2017\/09\/26185359\/PLAIN_Authentication1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4462 size-large\" src=\"https:\/\/cdn.kevinmaschke.com\/wp-content\/uploads\/2017\/09\/26185359\/PLAIN_Authentication1-1024x626.jpg\" alt=\"PLAIN Authentication\" width=\"1024\" height=\"626\" srcset=\"https:\/\/cdn.kevinmaschke.com\/wp-content\/uploads\/2017\/09\/26185359\/PLAIN_Authentication1-1024x626.jpg 1024w, https:\/\/cdn.kevinmaschke.com\/wp-content\/uploads\/2017\/09\/26185359\/PLAIN_Authentication1-400x244.jpg 400w, https:\/\/cdn.kevinmaschke.com\/wp-content\/uploads\/2017\/09\/26185359\/PLAIN_Authentication1-100x61.jpg 100w, https:\/\/cdn.kevinmaschke.com\/wp-content\/uploads\/2017\/09\/26185359\/PLAIN_Authentication1-406x248.jpg 406w, https:\/\/cdn.kevinmaschke.com\/wp-content\/uploads\/2017\/09\/26185359\/PLAIN_Authentication1-883x540.jpg 883w, https:\/\/cdn.kevinmaschke.com\/wp-content\/uploads\/2017\/09\/26185359\/PLAIN_Authentication1.jpg 1216w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<h3>Size Limits<\/h3>\n<p style=\"text-align: justify;\">This may or may not be necessary depending on the size of the accounts you are going to migrate, and the size of the emails and attachments. If you are not sure how big your accounts, its emails and attachments are, <strong>I&#8217;d suggest to increase the maximum allowed sized in Zimbra, and decrease them again later<\/strong>, once the migration is complete.<\/p>\n<p style=\"text-align: justify;\">First, verify the current maximum allowed sized, configured by default in Zimbra. I suggest copying these values so you can reset them later.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-title=\"Check Max Sizes\">zmprov getConfig zimbraFileUploadMaxSize\r\nzimbraFileUploadMaxSize: 10485760\r\nzmprov getConfig zimbraImapMaxRequestSize\r\nzimbraImapMaxRequestSize: 10240\r\nzmprov getConfig zimbraMailContentMaxSize\r\nzimbraMailContentMaxSize: 10240000\r\nzmprov getConfig zimbraMtaMaxMessageSize\r\nzimbraMtaMaxMessageSize: 204857600<\/pre>\n<p>Configure new size limits:<\/p>\n<pre class=\"EnlighterJSRAW\">zmprov modifyConfig zimbraFileUploadMaxSize 150000000\r\nzmprov modifyConfig zimbraImapMaxRequestSize 150000000\r\nzmprov modifyConfig zimbraMailContentMaxSize 150000000\r\nzmprov modifyConfig zimbraMtaMaxMessageSize 150000000<\/pre>\n<p>Check that the changes have been applied correctly:<\/p>\n<pre class=\"EnlighterJSRAW\">zmprov getConfig zimbraFileUploadMaxSize\r\nzmprov getConfig zimbraImapMaxRequestSize\r\nzmprov getConfig zimbraMailContentMaxSize\r\nzmprov getConfig zimbraMtaMaxMessageSize<\/pre>\n<p>Restart\u00a0<em>mailboxctl<\/em>:<\/p>\n<pre class=\"EnlighterJSRAW\">zmmailboxdctl restart<\/pre>\n<h2>ImapSync<\/h2>\n<p style=\"text-align: justify;\">With the information of the official <a href=\"https:\/\/imapsync.lamiral.info\/\" target=\"_blank\" rel=\"noopener\">ImapSync <\/a>website, its <a href=\"https:\/\/github.com\/imapsync\/imapsync\" target=\"_blank\" rel=\"noopener\">GitHub <\/a>site and the Zimbra <a href=\"https:\/\/wiki.zimbra.com\/wiki\/Guide_to_imapsync\" target=\"_blank\" rel=\"noopener\">Wiki<\/a>, I did a few tests with some fake accounts until I managed to migrate\/sync all folders and emails between Kerio Connect accounts and Zimbra Collaboration accounts. <strong>The final command I used was the following<\/strong>:<\/p>\n<pre class=\"EnlighterJSRAW\">imapsync\u00a0--nosyncacls\u00a0--subscribe\u00a0--syncinternaldates\u00a0--nofoldersizes\u00a0--skipsize\u00a0--noauthmd5\u00a0--host1\u00a011.11.11.11\u00a0--user1\u00a0user1@domain.com\u00a0--password1\u00a0123456\u00a0--host2\u00a022.22.22.22\u00a0--user2\u00a0user2@domain2.com\u00a0--password2\u00a0123456\u00a0-authmech2\u00a0PLAIN\u00a0--ssl2<\/pre>\n<p>The following were the options I used:<\/p>\n<pre class=\"EnlighterJSRAW\">--nosyncacls\r\n  Don't sync ACLs (Listas de Control de Acceso). Enabled by default.\r\n--subscribe\r\n  Subscribe to transferred folders on Server2 if subscribed on Server1. Enabled by default.\r\n--syncinternaldates \r\n  Sync the original mail dates.\r\n--nofoldersizes\r\n  Do not calculate the folder size before syncing them. By default it does calculate it, but we want to sync everything either way, so there's no point.\r\n--skipsize\r\n  Ignore sizes. Enabled by default.\r\n--noauthmd5\r\n  Don't use MD5 for the Authentication. Enabled by default.\r\n--authmech2 PLAIN \r\n  Authentication mechanism on Server2 (Zimbra).\r\n--ssl2\r\n  Use SSL on Server2 (Zimbra) if possible. Enabled by default.<\/pre>\n<h3>Monitor the logs<\/h3>\n<p><strong>Something very important which I recommend to to is to monitor the logs during each migration<\/strong>. This way you can see at all times what is being done and if any error occurs. To do so, we can use the simple command\u00a0<em>tail<\/em>:<\/p>\n<pre class=\"EnlighterJSRAW\">tail -f log\/mailbox.log | grep -i warn<\/pre>\n<h2>Calendars and Contacts<\/h2>\n<p><strong>ImapSync does not migrate calendars or contacts<\/strong> between servers and accounts, only folders and emails. In my case I simply exported the calendars and contacts from the accounts on the Kerio Connect server and imported them into the accounts on the Zimbra Collaboration server. There are other ways to do this, for example through Microsoft Outlook, the <a href=\"https:\/\/www.zimbra.com\/downloads\/zimbra-migration-tools\/\" target=\"_blank\" rel=\"noopener\">migration app from Zimbra<\/a> or other software, but in my case the number of accounts was not too big and I was able to do this manually.<\/p>\n<p>And here ends this tutorial! There are probably other ways to migrate accounts and emails between Kerio Connect and Zimbra Collaboration, but I did not find any that worked better for me than ImapSync and I personally think that it&#8217;s one of the most secure, fast and best methods. Try it out and let me know how it went or if you know any better alternative!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In previous posts we saw what Zimbra Collaboration is, which prerequisites are necessary for its installation, how to install and configure DNSMasq and finally, how to install Zimbra. Now we&#8217;re going to see how to &#8230;<\/p>\n","protected":false},"author":1,"featured_media":4518,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[410,207,219],"tags":[639,643,2018,647,2020],"class_list":["post-4476","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-guides","category-linux-en","category-technology","tag-email","tag-imapsync-en","tag-kerio-en","tag-zimbra-en","tag-zmprov-en"],"acf":{"book_cover":null,"special_featured_image":null},"_links":{"self":[{"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/posts\/4476","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/comments?post=4476"}],"version-history":[{"count":0,"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/posts\/4476\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/media\/4518"}],"wp:attachment":[{"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/media?parent=4476"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/categories?post=4476"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/tags?post=4476"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}