Can I back uP cOntacts in on file with Ifile

Discussion in 'Jailbreaks and iOS Hacks' started by himynameiscody, Feb 16, 2012.

  1. himynameiscody macrumors 6502a

    himynameiscody

    Joined:
    Oct 9, 2011
    #1
    Wirelessly posted (Mozilla/5.0 (iPhone; CPU iPhone OS 5_0_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A406 Safari/7534.48.3)

    Possible?
     
  2. Kar.ma, Mar 23, 2012
    Last edited: Feb 17, 2013

    Kar.ma macrumors newbie

    Kar.ma

    Joined:
    Dec 30, 2011
    #3
    All your Address Contacts are stored in this single (database) file:
    /var/mobile/Library/AddressBook/AddressBook.sqlitedb

    If you want to back up contacts images too, you can backup the entire AddressBook folder.

    If you want to read its content, you can export it to csv. I did it this way (in Windows 7):
    - copy AddressBook.sqlitedb to C:\temp\ (e.g.)
    - download sqlite3 command-line shell (from http://www.sqlite.org/download.html) and extract zip file in C:\temp\
    - open a Command Prompt and write (omit the "sqlite>" string):

    cd /d c:\temp
    sqlite3.exe AddressBook.sqlitedb
    sqlite> .mode csv
    sqlite> .output mycontacts.csv
    sqlite> SELECT ROWID, 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;
    sqlite> .quit

    Now you can open mycontacts.csv with Excel. I had a problem with my Italian Excel and had to replace all "," inside csv file to ";" (damn you Microsoft), before having it working.

    Drop here a line if this was useful to you.

    [EDIT 2012-03-23_09.53]
    For avoiding Excel from considering phone numbers as "numbers" I renamend .csv file to .txt. Choose Open in Excel and it will ask you for some questions. Be careful that in step 3 you need to choose "Text" manually for each column

    [EDIT 2013-02-17_11.54]
    I used my own guide again today, and found out a little mistake (there was a double "select"), which I corrected.
     

Share This Page