Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

xbpr

macrumors member
Original poster
Dec 8, 2008
81
7
The calendar app on my mac no longer shows the two calendars that I've been synchronizing through iTunes with a USB Cable. The interesting thing is that when I sync the phone to the mac, it appears that the the calendars are indeed synchronizing. I say that because I turned off calendar synchronization in iTunes, and selected the option to remove the calendars from the phone. I confirmed the calendars disappeared off of the phone. Then I turned calendar synchronization back on again and all of my calendars synchronized back to my iphone, including a third (brand new) calendar that I created on the phone as a test. So it appears that the sync function is working and the synchronized calendars exist on my Mac. However, they are not visible in the Calendar app. Any ideas how to get them back?

So far, I've tried:
  • Restoring ~/Library/Calendars/ folder from a Time Machine backup from various dates.
  • Deleting three "Calendar Cache*" files from ~/Library/Calendars/
  • Deleting ~/Library/Calendars/ folder completely.
 

xbpr

macrumors member
Original poster
Dec 8, 2008
81
7
I was able to get my Calendars back.

I ended up restoring the following files from a time machine backup from a few weeks ago:
  • ~/Library/Calendars/ directory
  • ~/Library/Preferences/com.apple.iCalExternalSync.plist
  • ~/Library/Preferences/com.apple.iCal.plist <- Not sure if this one was necessary.
I ran a few tests creating events in both locations and everything seems back to normal.
 

macstatic

macrumors 68020
Oct 21, 2005
2,010
163
Norway
I'm having a sync problem as well (long story short: calendars that I've deleted long ago suddenly reappear, despite removing them again and again. And now iTunes won't even sync or show my Contacts).

I've already exported all the Calendar and Contact entries, so I'm wondering if resetting both apps and the sync feature in MacOS would help, then re-import the Calendar and Contact files again. I've had this problem for years, and so far nobody's been able to help, nor have I found any solutions myself, so resetting things seems to be the next step.

I've tried deleting the entire Calendar folder (~/Library/Calendars/) and this apparently sets everything back to the factory default for the MacOS calendar, and I see you've done the exact same thing, but it didn't make the problem go away, so I suspect it might have to do with the sync function itself.
Will deleting the sync plist file (~/Library/Preferences/com.apple.iCalExternalSync.plist) reset the iTunes sync function?
I've also tried deleting (or rather disabling it by renaming it, just in case I still need it) a folder containing a file named "Local" (~/Library/SyncServices/Local) to no avail. A new folder/file was created automatically, so I'm not sure if I should delete the old one now or rename it back again.
I've found another folder which might have something to do with all of this (~/Library/SyncedPreferences/) which contains several files, but I dare not touch it before I find out what it's for.
I also can't figure out how to reset the Contacts app, so I can just start from scratch and re-import my saved contacts file again.

Oh, I just remembered that the "Containers" folder (~/Library/Containers/) might affect some of this, but I'm not sure so again I'm not going to mess with it before I get to learn some more.

If anyone knows how to reset whatever has to do with USB-syncing an iOS device to iTunes, please share!
 

xbpr

macrumors member
Original poster
Dec 8, 2008
81
7
One other thing I discovered after I got mine working again was that my calendar had been synchronized to icloud right around the time I started having problems with local iTunes sync. I’m not sure if that was part of the problem or coincidence. If you haven’t already, it might be worth while to log into your iCloud account on the website and see if you have contacts/calendars there. It won’t solve your reset question, but it might provide some clues as to what is happening.
 

macstatic

macrumors 68020
Oct 21, 2005
2,010
163
Norway
Thanks for the suggestion. I tried logging in there, but there were no entries to either the calendar or contacts.
 

macstatic

macrumors 68020
Oct 21, 2005
2,010
163
Norway
I've tried numerous times to start from scratch on the iPads (by selecting to replace all existing contacts and calendar information there when syncing), but no matter what those "undeletable" calendars show up at a later time when syncing in iTunes. So it doesn't look like it's the iPads' fault but rather something to do with the Mac side of things.

That aside I might have something working now.... :)
What I've done is delete (*) a whole bunch of folders and files assumed associated with the OSX Calendar, Contacts and iTunes USB syncing in order to start afresh, wiping away the "undeletable" calendars in the process.
(* actually I just renamed them by adding "----------" at the end of the file or folder name. That way I could always get them back if needed, and the "-----------" makes it quick and easy to distinguish from all the other file/folder names. I will delete them all once I have everything fully working).
Here are those folders and files (which were all, with a few exceptions, replaced with a new folder or file) that I deleted (renamed), then quickly logged out of the OSX user and back again:

"Library" folders deleted:
~/Library/Caches/
~/Library/Calendars/

"Application support" folders deleted:
~/Library/Application Support/AddressBook/
~/Library/Application Support/SyncServices/

"Containers" folders deleted:
~/Library/Containers/com.apple.AddressBook/
~/Library/Containers/com.apple.AddressBook.ContactsAccountsService/
~/Library/Containers/com.apple.CalendarAgent/
~/Library/Containers/com.apple.CalendarNotification.CalNCService/
~/Library/Containers/com.apple.CalendarFileHandler/ (NOT rebuilt after deletion!)
~/Library/Containers/com.apple.iCal.CalendarNC/ (NOT rebuilt after deletion!)
~/Library/Containers/com.apple.contacts.donation-agent/
~/Library/Containers/com.apple.ContactsAgent/
~/Library/Containers/com.apple.iCal/

"Preferences" files deleted:
~/Library/Preferences/ByHost/com.apple.AddressBook.sync.8111C514-017A-5840-9288-91E70350D374.plist
~/Library/Preferences/ByHost/com.apple.syncservices.8111C514-017A-5840-9288-91E70350D374.plist
~/Library/Preferences/ByHost/com.apple.syncservices.ConflictResolver.8111C514-017A-5840-9288-91E70350D374.plist (NOT rebuilt after deletion!)
~/Library/Preferences/ByHost/com.apple.syncservices.syncuid.8111C514-017A-5840-9288-91E70350D374.plist (NOT rebuilt after deletion!)
~/Library/Preferences/com.apple.iCalExternalSync.plist
~/Library/Preferences/com.apple.iTunes.plist
~/Library/Preferences/com.apple.syncserver.plist


After doing this I opened up (on the Mac) the Contacts app which by default just had my username and Apple as the two contacts there.
Likewise I opened up the Calendar app which by default had just a "Home" and "Work" Calendar but with no appointments of course.
When attaching (via a USB cable) one of my iPads (with all contact and calendar information removed, prior to the previous sync) to the Mac I noticed that in iTunes (the Info section on the left hand side, referring to the attached iPad), where the "Sync calendars" option is found there were a couple more groups that weren't in my OSX Calendar app: Found in natural language and Reminders. Strangely these weren't added to the OSX Calendar when re-syncing either, but perhaps they're meant to only stay on the iPad. Anyone know?

After syncing several times; adding, removing or changing calendar entries it seems to work correctly now (those two mystery calendars have me puzzled though), so either I've fixed the problem, or the problem lies within my Contacts and/or Calendar file (which I did of course export before deleting the said app prefs).
I read that a partly corrupt data file can cause a lot of havoc (but no instructions on how to detect a corrupt file) I suspect this might be the case here, and I guess I'll find out once I've tested the current setup a little longer just to be sure it works right, then import those Calendar and Contacts exported files:
Sometimes a sync failure will be caused by a single corrupt record in the contacts database. Finding it can be a problem, however. In my experience it is usually the first record. As it's a Mac you can try syncing using iCloud.

PS: would importing from those files also import a possible file corruption as well, or does the import function check every entry for data consistency?

On a sidenote: in case you were wondering how I got all those file and folder paths into this posting... I came across an article on how to create a File to Path OSX Service. So all I had to do was right-click the folder or file in question and select that Service which would allow me to simply do a CMD-V (paste) into this posting. Handy!
Screen Shot 2022-03-25 at 09.05.23.png

Screen Shot 2022-03-25 at 11.51.44.png
 
Last edited:

macstatic

macrumors 68020
Oct 21, 2005
2,010
163
Norway
It appears there's something strange going on with my contacts file. I've also tried exporting individual .vcf (VCard) files ("File"-"Export"-"Export VCard") then importing them again, but once again iTunes refuses to sync my contacts. But..... importing certain individual VCard files worked (as long as I had previously deleted ALL entried from the Contacts app) while others wouldn't. Very strange behaviour indeed!

I tried this with a handful entries which I had exported as VCard files, then I compared the ones that worked with the ones that didn't by opening them in TextEdit.
I noticed that the VCard files which didn't work all had additional fields (spouse, children, birthday, address etc.) while the ones that did work had less info (name, phone number, email etc.). It also seems that having the "long" ones in the Contacts app will prevent the "short" ones from being synced as well. Can anyone make sense of this and tell me what I should do to fix it?

As for syncing my Calendars -I believe I've solved that now! As far as I remember I synced the iPad with another Mac containing the same contacts, then replacing all my contacts already on the iPad. Next I synced the iPad to my main Mac (the one with all these problems) and making changes, additions etc. in my Calendar app all appear to be reflected in the next sync.
 

BrianBaughn

macrumors G3
Feb 13, 2011
9,674
2,427
Baltimore, Maryland
Could somebody remind me why, currently, a user would choose to sync contacts and calendars between their computer and an iOS device using a cable…as if it were an old Blackberry or Palm device?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.