Export Android contacts contacts2.db to vCard vcf on Windows

The other day I need to restore some contacts on an Android phone, I had Titanium Backup files, though restoring the contacts through there didn’t seem to work.

I searched for a solution but there wasn’t really anything for Windows to restore the contacts so I developed my own VBA script.

I will assume you already have a backup contacts2.db file, it is found the zip file com.android.providers.contacts.

Firstly, download SQLite Manager add-on for Firefox, run it, Connect Database contacts2.db. Under Tables, right-click data table and chose Export Table click OK and save as data.csv.

Download convert-contacts2.db data-to-vcard-vcf.xlsm, open, and enable macros if necessary. Run the macro convertDatatoContacts and select the data.csv file.

You should now have a list of contacts, delete any contacts that you don’t want to import by deleting the whole row. When done run the macro and a vCard.vcf file will be created in the same folder as the Excel WorkBook.

Copy vCard.vcf to the root  directory of your Android phone. On the phone enter Contacts, Settings, Import/Export and Import from storage. The contacts will be imported.

 


Posted

in

, ,

by

Comments

13 responses to “Export Android contacts contacts2.db to vCard vcf on Windows”

  1. abdulrahman Avatar
    abdulrahman

    work like a charm , the easiest way ever to restore your contacts manually..
    big thanks

  2. abdulrahman Avatar
    abdulrahman

    last step select (writeContactstovCard) and select this Workbook then run
    many thanks

    1. Yasser Mohamad Avatar
      Yasser Mohamad

      3ayzak tekalemny darory plz

  3. MaClaud Avatar
    MaClaud

    Great! thx

  4. Yasser Mohamad Avatar
    Yasser Mohamad

    @abdulrahman 7awel tekalemny darory plz

  5. Jon Hyatt Avatar
    Jon Hyatt

    Also works for converting Linux Evolution Mail address books from the new contacts.db to the old contacts.vcf for use in older versions or other Unix programs/
    Thanks

  6. Эльхан Исаев Avatar
    Эльхан Исаев

    Online contacts2.db to vcf 3.0 converter launched now
    gsmrecovery.ru

    1. sharu Avatar
      sharu

      wr it is storing after the convert

  7. hexdude24 . Avatar
    hexdude24 .

    thank you, thank you, thank you. I successfully recovered contacts from a motorola droid 4 with bad touch screen and usb debug mode off using one of the recovery modes and adb.

  8. hexdude24 . Avatar
    hexdude24 .

    Here are a few pieces of information that are not documented in the instructions that I had to figure out.
    To run the sqlite addon, you go to the three lines menu and choose customize at the botton and drag the sqlite icon to the menu and click it from there.
    You open the macro file from Microsoft Excel. I used 2010.
    The saved vCard.vcf file that the macro creates is stored in the same folder as the macro file was run from.
    Hope this helps.

    1. Michelle Nowak Avatar
      Michelle Nowak

      I guess, I missed some steps here. Can’t connect Database contacts2.db.

      SQLiteManager: Error in opening file contact2.db – either the file is encrypted or corrupt
      Exception Name: NS_ERROR_FILE_CORRUPTED
      Exception Message: Component returned failure code: 0x8052000b (NS_ERROR_FILE_CORRUPTED) [mozIStorageService.openUnsharedDatabase]

      Also can not not convert contacts2.db data to vcard vcf with makro. https://uploads.disquscdn.com/images/86d61c47cf635e2749d76b749c453dfc9402224188b78f098710106df96ef246.jpg

      Can anyone help what step I missed? Thanks!

  9. [GUIDE][GT-I9192][stuck at splash] how to get your data back – Android world

    […] databases to your new phone or inspect them via sqlite3.exe from your Android Development Tools. Here is a macro that could convert your contacts to […]

  10. harry tree Avatar
    harry tree

    I followed the instructions but all my contacts were given the number of “0”, i.e zero

Leave a Reply

Your email address will not be published. Required fields are marked *