Migrate Zimbra Calendars to KU Leuven Exchange

Migrating your Zimbra calendars to KU Leuven Exchange involves 2 steps: exporting them from Zimbra and importing the resulting .ics file(s) in Exchange.


What to do:

  • export your calendar(s) with the GUI or the command line into (1 or more) .ics file(s)
  • import your .ics file(s) with the procedure below (that knows about attachments) or with the standard import function of your calendar client (that most probably ignores attachments)

Importing Calendars in your KU Leuven Exchange

Unfortunately, the default OWA web interface of the KU Leuven Exchange does not allow to import calendars. You need to use another calendar client that does provide the import functionality.

Moreover, none of the calendar client software we have tested (Thunderbird, Evolution, Outlook), also import the attachments (yes, also calendar events can have attachments).

If you do not care about the attachments that come with (some) events, you can use the import functionality your calendar client provides.
If you do care about those attachments, you should not use the normal import function of your calendar client but use the special migrate procedure described below.

How to actually import the .ics file, of course depends on the client software you use. Some calendar clients that support importing .ics files are shown in our Exchange FAQ.

In both cases (either using the normal import of your calendar client or using the special attachment-aware procedure below), you should consider to:

  • when importing Zimbra calendars, we advise to first import them in a new, separate calendar to see if all goes well - if something fails, it is easy to delete that new calendar and try again - if you import into your default, main calendar and that import fails half-way, it might be difficult to delete what already was imported
  • if the import goes well, you can/should import again, but this time into your default, main calendar and then delete the extra, new calendar you used to test the import with - only your default, main calendar is used for your free/busy information

Importing Calendars with Attachments

Because the normal import functionality of a lot of (most?) calendar clients does not import the attachments as well, we have built a custom import procedure [credits] that does import the attachments:

  • login using ssh on one of the departmental public ssh servers: ssh.cs.kuleuven.be, ssh1.cs.kuleuven.be and ssh2.cs.kuleuven.be

  • use the command below to import your exported calendar to the CS-Migrated calendar in your Exchange mailbox - it will be created if it not yet exists:

    • cs-icsimport /path/to/your.ics CS-Migrated
  • cs-icsimport first parses the .ics file, which can take some time (minutes) - moreover:

    • the password that is being asked, is the one of your Exchange account (your u-number)
    • while importing, all events are shown on stdout
    • events that fail to be imported are saved in a failed-*.ics file (1 failed event per such file) so that they can be inspected later on
  • check whether the import was succesfull - both on the command line output and by using the OWA web interface

  • if all went well:

    • delete the CS-Migrated calendar using:

      • cs-icsimport --delete CS-Migrated
    • migrate again, but this time in your default, main calendar using:

      • cs-icsimport /path/to/your.ics default
    • do notice that the default argument is important

  • if something went wrong, check it and either ask helpdesk for help or try again

Exporting Zimbra Calendars

Exporting calendars from your Zimbra can be done in 2 ways:

GUI-based export in the Zimbra web interface:

  • goto the Preferences tab, choose Import / Export -> Export -> Calendar
  • choose whether to export all your calendars in a single .ics file or rather one by one - do notice that since you will import the .ics file in a single calendar, exporting them all together seems to make no sense.
  • save the exported calendar in a .ics file of your choice.
  • do notice that attachments are saved with the events

Command-line-based export using the REST interface/API:

wget --ask-password --auth-no-challenge -O - "https://$USER@zimbra.cs.kuleuven.be/service/home/$USER/Calendar?fmt=ics&icalAttach=inline" > my-calendar.ics




or:

curl --user "$USER" "https://zimbra.cs.kuleuven.be/service/home/$USER/Calendar?fmt=ics&icalAttach=inline" > my-calendar.ics




The above examples will export your default Calendar - replace Calendar with the name of the calendar you want to export. Moreover, if your $USER variable is not your departmental login name, replace it (twice in the above examples!) with your departmental login name.

Do notice the icalAttach=inline parameter in the REST URL - this is important to also export the attachments of events.

[Credits]

The import procedure that knows about attachments could not have been built without the help of Davy Preuveneers. His work gave us the .jar file that allows to import .ics files with attachments and is therefore able to do what all other tools (including Microsoft Outlook) cannot do. That jar comes with no support, but does seem to do what it is supposed to do: it has been used over the course of several years for non-trivial use. It uses standard EWS component libraries that are freely available.