Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Calendar corrupted. Need to restore from Time Machine

I've lost my calendars on my OS X box, and the loss was synced up to iCloud. Boo. Hiss.

But I do have a good backup on Time Machine from yesterday. I've researched it on the web and tried the various things suggested, and none of them worked. Looking for a rescue...

Here's what I've tried so far:

  1. I got the ~/Library/Calendars from yesterday out of my Time Machine and have them in a safe place.
  2. I disconnected my network (to not allow iCloud sync), deleted ~/Lirary/Calendars, and killed any process still accessing the calendars and emptied my trash.
  3. I disabled the Calendar option in iCloud prefs
  4. I rebooted and then copied my safe copy from TimeMachine into ~/Library
  5. I rebooted again (why not) and ran the Calendar app
  6. All I see at this point is a work and personal calendar, local. Both empty.
  7. Hoping against hope, I reconnect the network and enable iCloud, but all I see is the corrupted calendar.

It seems like the restored ~/Library/Calendar files may contain the local copies of the iCloud versions of the calendar but when I restore tat directory Calendar doesn't see them until I re-enable iCloud at which point the stuff in the cloud has precedence.

I also tried this. I have another computer running Yosemite, which was not connected to the internet when the problem happened. So I used the Calendar/Export command presumably to be used to import later. I moved that file to the first corrupted computer and tried importing that file into Calendar. That also didn't work.

HELP! Anyone have experience with this problem?

Posted on Jun 30, 2015 10:39 AM

Reply
8 replies

Jun 30, 2015 11:28 AM in response to pitofromarlington

If you synchronize any of your calendars with a server such as iCloud, disable that synchronization. Quit Calendar.

Triple-click anywhere in the line below on this page to select it:

~/Library/Calendars

Right-click or control-click the highlighted line and select

Services ▹ Reveal in Finder (or just Reveal)

from the contextual menu.* A Finder window should open with a folder selected. Enter Time Machine and restore that folder from the snapshot you want.

Relaunch Calendar and test. Your calendars should be as they were when the snapshot was taken. If you don't sync with a server, stop here.

If you do sync some of the calendars with a server, select each one in turn and then select

File ▹ Export ▹ Export…

from the menu bar. You'll get ICS files with the filename extension ".ics".

Re-enable sync. Usually, all the calendars you just restored will be deleted. That's not a problem.

Create a new calendar on the server for each one you exported and want to sync:

File ▹ New Calendar

Then import the calendar from the corresponding ICS file by double-clicking it. Follow the prompts to import the new events to the calendar you just created.

For calendars that you don't want to sync, just import them again. They'll appear in the calendar list under On My Mac.

*If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination command-C. In the Finder, select

Go Go to Folder...

from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.

Jun 30, 2015 11:40 AM in response to Linc Davis

Thanks... A couple of questions: When I restore the ~/Library/Calendars folder from Time Machine and then launch Calendar, I don't see the restored calendars there. I think it's because the calendars come from the "iCloud" calendar in Calendar.app and when I turn off iCloud that calendar doesn't appear.


Secondly the result of File/Export/Export is a folder with a bunch of subfolders named with a hex looking code. I assume each of those is for one of my original calendars. But how do I tell which folder goes with which calendar so I can try re-importing it? If I try reimporting the whole folder (with all the subfolders), after a bit of crunching, and no errors, I still don't see the restored calendars.


Thanks for any further help!

Jun 30, 2015 12:59 PM in response to pitofromarlington

You're right. Unfortunately, my step 1 didn't work as you predicted:


"When I restore the ~/Library/Calendars folder from Time Machine and then launch Calendar, I don't see the restored calendars there. I think it's because the calendars come from the "iCloud" calendar in Calendar.app and when I turn off iCloud that calendar doesn't appear"


Any ideas there?

Jul 1, 2015 3:01 PM in response to Linc Davis

Thanks for sticking with me!


Very specifically: I located the directory ~/Library/Calendars inside of time machine from a date when I am positive the calendars were all intact. I restored it to my desktop. I stopped iCloud, disconnected the network, exited from Calendar.app. T


hen I replaced the ~/Library/Calendars folder with the one that I got from Time Machine. I rebooted my mac, and then opened Calendar.app.


I would have thought that it would have restored my calendars from the earliest date. But what I got was an empty calendar with only Work and Personal (which I think is what it is initialized to if there's nothing there. In other words it acted like it didn't see any of the calendars that I had gotten from Time Machine and copied to the right place in my ~/ directory.


My hypothesis is that somehow the place in ~/Library/Calendars where iCloud synced calendars are stored is different from where the local ("on this mac") calendars are. Which is why I see nothing and so I can't export them to protect them.


Then, if/when I turn on iCloud again, the calendars that I restored from Time Machine are erased by the sync and the state reverts to what was stored in iCloud (post corruption.)


What do you think of my theorizing?

Jul 2, 2015 3:08 PM in response to pitofromarlington

Back up all data before proceeding.

Triple-click anywhere in the first line below on this page to select it:

~/Library/Containers/com.apple.CalendarAgent

~/Library/Containers/com.apple.iCal

Right-click or control-click the line and select

Services Reveal in Finder (or just Reveal)

from the contextual menu.* A folder should open with an item selected. Quit the application if it's running. Move the selected item to the Trash.

Repeat with the second line.

Relaunch the application and test.

*If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination command-C. In the Finder, select

Go Go to Folder...

from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.

Calendar corrupted. Need to restore from Time Machine

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.