So you reformatted your mac and didn’t back up your AddressBook contacts? Whoops. That’s ok though, if you have a jailbroken iPhone you can restore your AddressBook contacts with a little bit of hackery. So lets get started!
1. SSH into your iphone, and get r00t.
TheGame:~ egeste$ ssh email@example.com firstname.lastname@example.org's password: iPhone:~ root:
2. Go into the mobile user’s home dir and create a backup folder
iPhone:~ root: cd /var/mobile iPhone:/var/mobile root: mkdir Backup
3. Copy the AddressBook databases into your backup folder
iPhone:/var/mobile root: cp Library/AddressBook/* Backup/
4. Open up iTunes and plug in your iPhone/iPod Touch (if it’s not already). In iTunes, click on your device under Devices, then click on the tab for Info. Check the box to sync your contacts, then click sync. iTunes will ask you if you want to do this because blah blah blah whatever, just do it.
5. Once the sync is complete you will notice that all the contacts are gone from your phone. DON’T FREAK OUT. return to your SSH session and copy the database files back to their original location like so:
iPhone:/var/mobile root: cp Backup/* Library/AddressBook/
6. If you check your phone contacts again you should see that all of your contacts are back. Now all you need to do is sync your phone again. BLAMMO! iTunes should have imported all the contacts from your iPhone into AddressBook. You may have to do some merging and whatnot.
I suppose this would work for Outlook contacts as well, but I haven’t tested it.
Anyway, that’s all for now.