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.


  • abdulrahman

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

  • abdulrahman

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

  • MaClaud

    Great! thx

  • Yasser Mohamad

    @abdulrahman 7awel tekalemny darory plz

  • Yasser Mohamad

    3ayzak tekalemny darory plz

  • 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/

  • Эльхан Исаев

    Online contacts2.db to vcf 3.0 converter launched now

  • 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.

  • 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.

  • Pingback: [GUIDE][GT-I9192][stuck at splash] how to get your data back - Android world()

  • sharu

    wr it is storing after the convert

  • 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 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!