A few days ago, my Things-on-Mac stopped synchronizing with my Things-on-iPhone. I tried everything on the CulturedCode forums and from the CulturedCode support emails without success. It took a while to debug this, so here are details, in case it helps others (or I have to do this again!)
What am I running:
- MacBookPro running OSX 10.6.4
- Things-for-Mac v1.4.2 (1420)
- iPhone 3G running v4.1 (8B117)
- Things-for-iPhone v1.6.1
Individually, I could use Things on Mac, and on iPhone, just fine. However, any attempt to synchronize between the two would cause a progress dialog box on Mac saying “Preparing…” which would just hang, until I force-quit it. In case I was being too impatient, I left it running overnight once but it was still just as hung in the morning.
This hang happened 100% of the time. This hang happened regardless of whether I started synchronization on Mac with File->”Sync with … now”, or on iPhone, by starting Things-on-iPhone while on same wifi network as mac. This hang happened on my home wifi network and also on the office wifi network, and even when I had no other applications running on my mac.
This setup has been working without problems for months, and I hadnt installed any new software or updated any existing software, so I’m still baffled what caused this problem.
Here’s some things I tried first, unsuccessfully:
- rebooting mac, rebooting phone, clicking sync. Hang.
- rebooting mac, rebooting phone, removing phone from list of devices, adding phone into list of devices, re-pairing iPhone to mac, clicking sync. Hang.
- removing things from iphone and reinstalling through itunes, rebooting mac, rebooting phone, removing phone from list of devices, adding phone into list of devices, re-pairing iPhone to mac, clicking sync. Hang.
- Repeat all of the above on home wifi, and then again on work wifi.
- At home I also tried all of this after rebooting my home wifi access point.
- All to no success.
At that point, I remembered the idea of taking backups, so backed up the entire Things data directory, which in my case, was in /Users/john/Things:
$ cd /Users/john
$ rsync -av Things Things-2010-10-01
Note: using “rsync” preserved the timestamps, in case that was part of the synchronization logic.
Here’s the steps that fixed it:
- remove Things from iPhone
- exit Things on Mac
- inside the Things directory on Mac, there is a “Backups” directory. This contains daily backups of your Things data. I copied the oldest backup over the current “latest” Things data file, as follows:
$ cd /Users/john/Things/Backups
$ cp DatabaseBackup\ 2010-09-29\ \(653\).xml ../Database.xml
- reinstall Things on iPhone
- start Things on iPhone
- start Things on Mac
- remove phone from list of devices, add phone into list of devices, re-pair iPhone to Mac
- exit Things on Mac, Things on iPhone
- start Things on Mac, Things on iPhone, and click sync.
- It took several minutes of “Pending…”, but this time the progress bar was moving which gave me hope. After a few minutes of this, success! I could now see all the items on my ToDo on both devices!! OK, it was all from almost a week old backup – but still, encouraging progress.
At this point, my theory was that something happened during the week that corrupted the Things data xml file. The files were all still valid xml files, so something more subtle was wrong. To find when the corruption happened, I repeated these steps for each different backup, each time copying up the next newest backup. In theory, once I found the corrupted xml file, sync should not work again. However, following the process above, each restore attempt worked, all the way to the latest backup! I ended up with the latest contents of my Things-on-Mac finally visible again on my Things-on-iPhone.
Final step was to do a quick test update on Mac, along with another test update on iPhone, then syncing to verify that both changes were handled correctly. This worked fine too – so everything is good!