This is it. After over a decade, I had to install a different E-mail/Collaboration server than Zimbra.
Carbonio from Zextras is a great tool and if it still has a lot to improve it’s ready to go in production and fulfill most users needs to replace Zimbra as a popular E-mail server.
Don’t fool yourself, Carbonio is a lot different and have many extra components, but its core still is a Zimbra., meaning that most “zm” commands are available and also it’s 4 pillars mysql + openldap + postfix + jetty still are there. What Zextra did so far was add a new interface, LibreOffice, and a service networking solution called Consult to help integrate it all. It’s a pretty damn good work.
After many tests in a controlled environment, I finally migrated my first server to Carbonio and I took inspiration from a very handy tool done by Fábio Schidt called Z2Z to make those scripts to help migrate from Zimbra to Carbonio.
In the end, I realized that processes were not so different, and with just a few adjusts it could also be used to migrate from Zimbra to Carbonio and vice-versa, but also from Z2Z and Z2Z =)
INSTALL
Z2C is a quite simple pair of scripts to export LDAP data from an origin Zimbra or Carbonio server and import it on a brand new Zimbra or Carbonio server. Its goal is to migrate accounts and help dump and restore mailboxes from one server to another.
z2c.sh will not export any mailboxes mails, calendars, tasks, or contacts itself. It creates the scripts to do so. After running it take a closer look at the export folder.
As simple as it is, there is no need to install anything. Just run the scripts:
1 – run z2c.sh to export it all from the original server
2 – copy the Z2C folder to the new server
3 – fix its permission on the new server
4 – run restore.sh to import it on the new server
Those steps will export users, aliases, and lists from the origin server and import them to the destination server.
MAILBOXES
Once you have all domains, accounts, aliases, and lists imported on the new server it’s time to dump mailboxes on the original server, copy it to the new one, and then restore it there.
Z2C makes it pretty easy for you, to create a full set of scripts:
script_export_FULL.sh -> a list of zmmailbox commands to dump all mailboxes;
script_export_TRASH.sh -> a list of zmmailbox commands to dump the Trash folder, because it's not dumped on the regular command and some users can't live without it's Trash
script_import_FULL.sh -> a list of zmmailbox commands to restore all mailboxes;
script_import_TRASH.sh -> a list of zmmailbox commands to restore the Trash folder, because it's not restored on the regular command and some users can't live without it's Trash
script_import_quota.txt -> a list of zmprov commands to restore all accounts quotas if you need it;
users.txt -> just a list of users to make it at hand in case you want to script anything #nerdfellings
PARALLEL
You may consider installing and running those scripts using parallel to make dumps and restores faster.
Those scripts are great but it may take quite a long time to run it if you have hundreds or thousands of accounts, so be able to run many at the same time in a nonstop way it’s faster, by far.
Just take care to don’t do too many at the same time, your server may not be able to deal with the overload. We suggest you use between 3 and 5 simultaneous dumps/restores, but feel free to test it out.
This is how you use it:
parallel -j4 < script
-j4 -> where 4 is the number of processes it will run at the same time;
script -> the name of that file with the list of commands you wanna it to process
TIPS&TRICKS
Sometimes zmmailbox aborts processing with a “timeout” error despite the fact we’re using “-t0” flag option.
The workaround is to change socket_so_timeout option to a very high time before start importing those mailboxes dumps and restore its default value when it’s over. So here you
have it:
zmlocalconfig -e socket_so_timeout=99999999
zmlocalconfig --reload
Then import it all
To restore default values do:
zmlocalconfig -e socket_so_timeout=30000
zmlocalconfig --reload
Error 500
When running import scripts you may see this error message:
ERROR: service.FAILURE (system failure: POST failed, status=500 500)
There is nothing to worry about. That error happens because it is trying to import an empty file. When Z2C exports data from Zimbra, some files get no content and end up empty.
Wish it helps!
Enjoy!
Hi, googd article. Thanks.
Did you install MagicSpam in Carbonio?