View/Export contacts from iPhone AddressBook.sqlitedb file
Recently I updated my iOS to 4.3.1. I tried replacing the AddressBook.sqlitedb file on iPhone to restore my contacts, but it doesn’t seem to work. I guess there is some bug in iOS 4.3.1 and it might be fixed in 4.3.2. But, I need my contacts back. So I did some research, and here is how you can get the contacts in a CSV file.
1. Open AddressBook database
Open Firefox and install the SQLite Manager add-on for Firefox, restarted firefox. Goto Web Developer->SQLite Manager. On SQLite Manager window click the open icon and selected AddressBook.sqlitedb.
2. Open the Execute SQL tab and execute the following query
select ABPerson.prefix, ABPerson.first,ABPerson.last, ABMultiValue.value from ABPerson,ABMultiValue where ABMultiValue.record_id=ABPerson.ROWID
if you want to get more details;, e.g, notes, birthday, etc., use the following query
select ABPerson.prefix,ABPerson.suffix, ABPerson.first,ABPerson.middle,ABPerson.last, ABMultiValue.value, ABPerson.note, ABPerson.nickname, ABPerson.organization, ABPerson.department, ABPerson.jobtitle, ABPerson.birthday from ABPerson,ABMultiValue where ABMultiValue.record_id=ABPerson.ROWID
And wollah, there are all your contacts.
3. Hit the Actions button and choose Save Result(CSV) to file
there you have all your contacts in a CSV.