November 7, 2006

Restoring AddressBook.app contact entries

I will be focusing on a problem that a certain number of people on the Mac OS X + iSync platform face on a regular basis. First I will start by giving some examples of the cases that might make one want to restore AddressBook contact entries.


The inadvertent phone contact deletion example:
somtimes we make mistakes and delete certain contacts from our phones. Sometimes these are not our mistakes but the mistakes of other people who have played around with our phone. For example when you buy a new device and your friend is checking it out and she indavertently deletes an entry but does not even realize that she did. One way or the other, some important contact entries on our phones get deleted accidentally. And if you're like most Mac users, you probably iSync your phone with your computer's addressbook database and this means that those contacts will also get deleted there. So the next time you're looking for that number, it's neither on your phone, neither in your AddressBook database and all of the sudden, cold sweat and other panic symptoms start settling in...


The .Mac syncing example:
I have never really used .Mac myself. But I've heard horrible stories about it. This seems to be one of those areas where Apple still need to spend some engineering money and make it worth the price it asks for subscribing to the service. Anyways, one of the stories that keep on coming back and forth is that sometimes, while syncing with .Mac, iSync hangs and for some strange reason deletes all contact entries in the AddressBook database it was syncing to .Mac. Users start panicking and don't always get the best of help from Apple's support service.


The "Howto" for Restoring your lost contact entries:
First of all, when iSyncing any device with your local databases, backups are created. However, those backups are not accessible and not easy to restore, at least for the "common" user. This is a guide on how to restore the backed up AddressBook database. The method is as follows:

- Make sure you're in Finder, if you're not sure what Finder is, just click on an empty space on the desktop of your operating system (Mac OS X is assumed to be your OS).

- Do the following key combination: "Command + Shift + G". In the textbox that appears, type the following: ~/Library/Application Support/AddressBook

- In the Finder window that opens, there will be a certain number of files and directories. The ones relevant to us are the files named AddressBook.data which represent your current addressbook database entries and AddressBook.data.previous, which is the backup made by iSync before things got ugly (referring to one of the two examples above).

- Before proceeding any further, it would be a good idea to make a backup of both files AddressBook.data and AddressBook.data.previous.

- Once the files have been safely backed up in another directory or maybe even on your USB Flash disk, rename AddressBook.data to something like AddressBook.data.7_Nov_2006 (the appended date is not necessary but is useful for future reference). We could have named the file AddressBook.data.my_current_manual_backup and it would not matter.

- Then rename the AddressBook.data.previous file to AddressBook.data

- The next step is to relaunch AddressBook.app and you should see your erased contacts back where they belong.

To iSync or not to iSync, that is the question:
So now, your contacts are safely back into AddressBook.app and you can finally call that old friend of yours! However, you really loved that feature iSync provided you by keeping both your computer and cellphone and .Mac service up-to-date. After the last event, you're now really scared to try synchronizing again and wondering what you should do. Well I'd say, go ahead and sync away! But just before you do that, since the AddressBook contacts will appear as new data to any device or service you're syncing too, and since the behavior of iSync in that case is unpredictable, I would advise you make a quick backup that you can revert to before going ahead.

Such a backup can be done from within AddressBook.app itself and will not necessitate all the process we went through earlier. It should also be noted that you can sync without doing it and this is just an advisory one-time procedure just so that if things went wrong, you could get your contact entries back effortlessly.

Method for backing up your AddressBook:

- Launch AddressBook.app if it weren't already.

- Choose File menu => "Back up Address Book..." option.

As you can see, the File menu also gives you the option to revert your AddressBook database to a previously backed up file.

Now you can safely go ahead and restart appreciating the joys of iSync + .Mac or iSync + "Freaking Cool Bluetooth Enabled Incredible Super Duper" cellphone. ;-)


Last note on the topic:
I've had quite some experience with syncing apps, the SyncML standards and a few other syncing related topics. None of them so far are perfect mostly because synchronization of data is still hard to achieve at the moment and most programming done out there are based on tricks and algorithms that break on certain rare conditions. So, when syncing, users should always keep in mind that something might go wrong. Actually, syncing is something I do often, but it's also one of those activities that worries me. So after every sync, I run quick checks to make sure that things that are supposed to be there are at the right place with the right attributes (cellphone number, emails, chat addresses, etc...) and so on.

2 comments:

  1. I wish I had read this before I messed around with it myself. The "previous" file solution has all the old info in it but when launching Address Book it only shows two entries, my account info and Apple.com. I must have done something else to corrupt it. I'm going to sync manually from now on and do a backup before I sync. This was too costly.

    ReplyDelete
  2. Hi, Thanks! I tried what you suggested and my contacts still no where to be found!! Got any ideas?

    ReplyDelete