Wednesday, December 30, 2009

iPhone contacts restore from iTunes backup

Well, I bought an iPhone. YEY!

I started to play with it (jailbreak off course…) and I did something wrong with the configuration for the tethering.

Next thing I know, I can’t connect to 3G nor to WiFi.

Some exploring brought me to the conclusion that restore is supposed to solve the issue. The problem is that when I choose to restore my phone with settings from backup – the problem came back.

I had to do a clean restore and to recreate everything!!! :(

I was ready to reinstall all my apps (both appstore and cydia), but I totally forgot about my contacts! (note to myself: iPhone is also a phone!)

Well, here comes the interesting part of this story. It took me some googling, but I managed to find a way to restore the contacts from the previous backups!

Here is how it is done:

Disclaimer: This is probably not the only way, and maybe even not the best one, but it worked for me. I take no responsibility if something happens (or doesn’t) with your iPhone, cat, wife or grandfather during the process.

1. Jailbreak your iPhone (Google to know how) and install Cydia
2. Install OpenSSH from Cydia on iPhone
3. Install WinSCP on your computer.
4. Download iPhoneBackupExtractor (Free version allows to extract only one file, but it was good enough for me…). No need to install, just execute the exe file.
5. Run the iPhoneBackupExtractor, choose the backup date:
image 
Click next.
Choose the following option:
   image 
Next.
Now you will have to choose the file to restore. There are two of them for the contacts. If you use the free version of the backupextractor you will need to follow the previous steps twice to get both of the files. The files you need are located under (surprisingly) “AddressBook” folder:
image 
As the file names imply, the first is the address book, the second is the images for the address book.
Store the files in some folder you will be able to find later…
6. Now let’s copy the file to the iPhone.
Connect with WinSCP to iPhone (here is how)
7. Browse to /var/mobile/Library/AddressBook
You should see there two files with suspiciously familiar names. Where did you see these names before?
8. Drag&Drop the files you just restored from backup to the above folder in winSCP program, and agree to replace the existing files.
9. You have your contacts back!!!