This weekend I was accidentally deleted an iCloud Calendar. And of course, thanks to Apple’s quick sync the Calendar disappeared from all my devices in no-time :(
Here’s how I managed to restore the Calendar:
- In Finder, hold the ⌥ option key to go to the otherwise hidden Library folder under the Go menu.
- Navigate to Calendars.
- Find out which
*.caldav
folders is of your iCloud Account by checking theirInfo.plist
. - In that folder, take note of all remaining
*.calendar
folders. - Enter Time Machine.
- Browse back in time until you see a new
*.calendar
folder appear. - Restore the folder to a temporary folder like your Desktop.
- Use this NodeJS script to prepare the
*.ics
files. It generates a new UID and removesX-*
tags so that iCloud will treat them as new events. If you don’t, the events will import at first, but then automatically get deleted again after some time.123$ npm install$ node ics.js ~/Desktop/ABC.calendar/Events ~/Desktop/output - Open Calendar and create a new iCloud or local Calendar.
- Select all
*.ics
files and drag them on the new Calendar in the sidebar. Don’t drop them on the Dock item – it will open a dialog for each event.
You’re welcome.