Migrating your digital life sounds easy until it isn’t. After reading Simons blog post on Self Hosting and, in broader strokes, tech independence. I’ve finally went down the rabbi thole of migrating Calendars and Contacts over to Nextcloud.
Contacts were fairly easy, also thanks to the Progress that has been done on the Google Integration Application in the past few months. Back in December, this looked much different. So I’m happy that a lot of movement on the Integration is done. ❤️ Open Source!
This will be mostly a rough breakdown of what worked and where I needed to read up and learn things to fix the migration.
If you have the same task at hand Import via Google Integration – If everything imports without errors and your calendar apps sync – You are golden! Stop reading, enjoy your life!
The other Side
I on the other hand found myself with an imported calendar. It was working wonderfully on the phone, but on Apple Calendar I only got the ambiguous Error 3. Nothing more and after a bit of poking around I gave up because something was obviously not working.
As a workaround, I tried importing the .ics file manually. It kind of worked and most events showed up, but around 70 to 80 just didn’t make it. No error messages. Nothing obvious. If it had been below 10 I’d just ignore it and go on with it, but it seemed a lot of events that are for some reason corrupt.
Most of the help articles and forum posts I found tell you now to check if you have a valid ICS file. I spend a few hours digging through the file with validators, but as it’s a Google Export, I’d kind of expect it to be valid. So pivoting again and looking into logs was next.
Enabling the logging in Nextcloud is fairly easy:
'loglevel' => 1,
'log_type' => "file",
'logfile' => "nextcloud.log",Once logging is enabled, I started another manual import and watched the file during an import. Finally, I got something useful:
"CustomMessage": "Validation error in iCalendar: The supplied value (1-01-01T00:00:00Z) is not a correct DATE-TIME"I mean, this is at least a start now!
I opened the ICS file—which contains a good chunk of my digital life spanning back 10+ Years, and started digging. Eventually I found the entries with a very weird CREATED date, to be more exact:
CREATED:00010101T000000ZYear 0001? I have no idea why Google generates this, but clearly it breaks the parser.
As one does, I ended up reading into RFC 5545 to see if the CREATED field was mandatory. Section 3.6.1 of the RFC does define CREATED as an optional field. So brace for impact, we’re just going to remove those lines and retry the import.
And this worked🎉!
Obviously this took a few hours to get there by debugging and spelunking into RFC’s (which is not a bad thing at all) sadly and a bit better error handling for imports would have been nice but… all in all I’ve migrated my Google Calendars and Contacts over to Nextcloud.
One step closer to self-hosting my own things