Exporting calendars and contacts from Google and Microsoft
Module 5: Calendar and contacts · Reading time: 12 minutes
Learning objective: After this lesson you can make a complete and usable export of calendars and contacts from Google and Microsoft, read an ICS and vCard file, and you know what does not come across, or comes across differently, when exporting.
Key concepts: iCalendar (ICS), VCALENDAR, VEVENT, UID, DTSTART, RRULE, EXDATE, VTIMEZONE and TZID, ORGANIZER and ATTENDEE, VALARM, vCard (VCF) 3.0 and 4.0, csv, Google Takeout, migration tool
Two file formats almost everyone knows
You move calendars and contacts using two open formats:
- iCalendar, files with the extension
.ics(RFC 5545), for calendars and tasks. - vCard, files with the extension
.vcf, for contacts. There are two versions you'll come across: 3.0 (RFC 2426) and 4.0 (RFC 6350).
These are plain text files. You can open them in a text editor, and that's exactly what you'll do in this lesson. If you know what's in there, you can also see what's missing.
There's often an easier route than exporting: many new services have a migration tool that, with your permission, fetches your calendars and contacts directly from Google or Microsoft. That's faster and leaves less room for errors. Still, making your own export is wise: as a check (how many appointments and contacts did I have?), as a backup before you cancel the old service, and as a fallback if your administrator doesn't allow the migration tool.
What a calendar file looks like
An export of Bakkerij De Korrel's calendar starts like this:
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Google Inc//Google Calendar 70.9054//EN
BEGIN:VTIMEZONE
TZID:Europe/Amsterdam
...
END:VTIMEZONE
BEGIN:VEVENT
UID:3f1a9c2e7b@google.com
DTSTART;TZID=Europe/Amsterdam:20261110T060000
DTEND;TZID=Europe/Amsterdam:20261110T070000
RRULE:FREQ=WEEKLY;BYDAY=TU
EXDATE;TZID=Europe/Amsterdam:20261229T060000
SUMMARY:Levering meel
ORGANIZER:mailto:anne@example.com
ATTENDEE;CN=Groothandel:mailto:verkoop@example.net
BEGIN:VALARM
TRIGGER:-PT30M
ACTION:DISPLAY
END:VALARM
END:VEVENT
END:VCALENDARWhat you're looking at:
| Line | Meaning | Where it can go wrong |
|---|---|---|
BEGIN:VCALENDAR and VERSION:2.0 | this is an iCalendar file | if missing, the import will be rejected |
BEGIN:VEVENT ... END:VEVENT | one appointment | a missing END makes the rest unreadable |
UID | the fixed identifier of the appointment | without a UID the server can't recognise duplicates |
DTSTART;TZID=... | start time in a time zone | see time zones below |
RRULE | recurrence rule: every Tuesday | an invalid rule gives a single appointment instead of a series |
EXDATE | exception: not this Tuesday | |
ORGANIZER, ATTENDEE | who invited and who is invited | see invitations below |
VALARM | reminder, 30 minutes beforehand | not every service carries reminders over |
Time zones
A time with TZID=Europe/Amsterdam means: 6 a.m. in Amsterdam, even after the switch to summer time. The file should therefore also contain a VTIMEZONE block describing that time zone. Exports from Outlook often use Windows names such as W. Europe Standard Time. That's fine as long as the VTIMEZONE block is included. If it's missing, the new service has to guess, and you'll see appointments shifted by an hour. A time ending in Z (20261110T050000Z) is in UTC and always unambiguous. A time without a time zone and without Z is called a "floating" time: it applies in the time zone of whoever views it.
All-day appointments appear as a date without a time: DTSTART;VALUE=DATE:20261224.
Invitations
An appointment you organised appears in the file with you as ORGANIZER. After the import, it will be in your new calendar, but the attendees will still have it in their own calendar as an invitation from your old address, with a UID from the old service. If you change the appointment later, they'll receive a new invitation. For recurring meetings with external parties, it may be tidier to invite them afresh after the switch. Appointments you were invited to come across as ordinary appointments; replies to the organiser go by email.
Exporting from Google
- Calendar: in Google Calendar, under Settings, the Import & export section, the Export button. You'll get a zip file with one ics file per calendar you own. Calendars that others share with you are not included; the owner exports those, or you export them per calendar from that calendar's settings if allowed.
- Contacts: in Google Contacts, select the contacts (or all of them), choose Export, then the vCard format. Google also offers "Google CSV" and "Outlook CSV"; choose vCard, as it keeps the structure (multiple phone numbers, addresses, photo).
- Everything at once: Google Takeout (takeout.google.com) delivers the calendar as ics, contacts as vcf (or csv) and Gmail as mbox, in zip files. Handy as a backup of the whole account.
The menu names change from time to time; if in doubt, search Google's help for "export calendar".
Exporting from Microsoft
- Calendar: in classic Outlook for Windows you can save a calendar as an iCalendar file (Save As, with a choice of period and "full details"). Choose a period that goes far enough back and forward, and choose full details, otherwise you'll only export free/busy information. In Outlook on the web you can publish a calendar as an ICS link and download the file via that link; turn the publication off again afterwards.
- Contacts: Outlook on the web exports contacts as csv, not as vCard. Classic Outlook also exports in bulk to csv; vCard is only available per contact there. Many CardDAV services can't import a csv file directly. Two workarounds: use your new service's migration tool (which fetches contacts directly), or import the csv into a Thunderbird address book and export it from there as vCard.
- Shared calendars and room calendars are organisation calendars. The administrator exports those, or you set them up again in the new service.
What does not come across, or comes across differently, when exporting
| Item | What happens |
|---|---|
| Attachments on appointments | usually don't come across; only a link, or nothing |
| Colours and categories | sometimes as CATEGORIES, often not |
| Reminders | sometimes, depending on the service |
| Video meeting links (Teams, Meet) | remain as text in the appointment, but stop working once you cancel the service |
| Contact groups or labels | not always; check after the import |
| Contact photos | come across in vCard, but make the file large |
Counting before you continue
Before exporting, write down how many contacts you have and, for a few calendars, how many appointments fall within a fixed period (for example, November). After the import, count again. That's the fastest way to spot that something is missing. In this lesson's exercise, you'll have the program count and check your files.
In practice: what this looks like at a provider
In a WebOké Nextcloud, there are two migration tools that fetch directly: the WebOké Import Tool for Google (Drive, Photos, Calendar and Contacts) and Data migration for OneDrive and Microsoft 365, which also lets you import contacts and calendars from your Microsoft account. If your calendar comes from somewhere else, you import ics and vCard files yourself (lesson 5.3). Nextcloud reads vCard 3.0 and 4.0. Other European services have comparable import tools or an import button in the calendar and address book; the file formats are the same everywhere.
Summary
- You move calendars as ics (iCalendar), contacts as vcf (vCard 3.0 or 4.0); these are readable text files.
- A migration tool that fetches directly is often easier, but make your own export anyway as a check and backup.
- In an ics file, pay attention to UID, RRULE, and time zones with a VTIMEZONE block; without that, appointments shift.
- Outlook on the web only exports contacts as csv; use a migration tool or convert the csv to vCard.
- Count contacts and appointments beforehand, so you can see after the import whether anything is missing.
Quiz
Exercise
Exercise A5.2: Checking your test export. Export a calendar (ics) and your contacts (vcf). First fill in how many contacts you have and how many appointments you expect. Then upload the files. The program checks whether they're valid, counts appointments, recurrences and contacts, looks for time zones without a description and duplicate contacts, and compares the results with your figures. The files are only read and not stored.
Exercise E5.2: What doesn't come across? Open your ics file in a text editor. Find a recurring appointment, an appointment with attendees and an appointment with a video meeting link. Note down, per appointment, what you need to do after the switch.
Exercise E5.2: What doesn't come across?
Open your own ics file in a text editor.
Your ticks and notes only stay in this browser; we don't send them anywhere. If you're signed in, we only save in My courses that you've done the exercise.
Further reading
The steps in these articles apply to WebOké's services; with other providers it works in a similar way.
- Nextcloud manual 13.5: Moving your calendar and contacts from Google, iCloud or Outlook (ics and vCard)
- Nextcloud manual 13.2: Transferring Google Drive, Photos, Calendar and Contacts with the WebOké Import Tool
- Nextcloud manual 13.4: Transferring OneDrive with Data Migration
- Nextcloud manual 13.6: Switching from Microsoft 365 to WebOké: files, documents, mail and calendar
- RFC 5545 (iCalendar), RFC 2426 (vCard 3.0), RFC 6350 (vCard 4.0)
- Google Calendar help: Export events; Google Contacts help: Export contacts; Microsoft support: Export contacts from Outlook
