This solution is for extracting from a backup on your mac. there are other option out there if you are trying to extract from a “live” iPhone or using a PC but i wanted to share a process that worked for me. No need to pay $30 or $99 for an app you only need to use for a few minutes.
1. start by using this free tool to extract AddressBook.sqlitedb from the backups stored on your mac: iPhone Backup Extractor from supercrazyawesome.
you will want to extract the last item on the list called “iOS Files” – it might take a while to download all those item. open the iOS Files folder and you will find a folder called “AddressBook” (it might be in the Library folder). that is the folder that contains AddressBook.sqlitedb
2. Open AddressBook database:
There are many paid options out there but here’s a free one: Open Firefox and install the SQLite Manager add-on for Firefox, restart firefox. Goto Web Developer->SQLite Manager. On SQLite Manager window click the open icon and selected AddressBook.sqlitedb.
3a. 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
3b. if you want to get more details (notes, birthday +) 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
4. Hit the Actions button and choose Save Result(CSV) to file
now you can import that CSV into the contacts app using the ‘import’ function. it even has a ‘look for duplicates’ option that can help if anything went wrong in this process.