Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I recently made an .img using dd of my Froyo installation on my phone prior to wiping and installing a custom Jellybean ROM. Turns out that the contacts were saved locally and not with Google.

I cannot for the life of me find my contacts anywhere on the images when I mount them. I've also tried attaching the .img as an external SD card to see if it could import and then export the contacts in a virtual android emulator. I just can't find them anywhere. I'm guessing they're hidden in some sql database somewhere in the guts of the OS but I'm out of ideas. Is there a way to boot the .img as the main OS on the Android emulator? Is there an easier way to go about this?

share|improve this question
up vote 14 down vote accepted

Well, this took a long time. For future searchers, here's what you can do:

Find your contacts2.db file hidden somewhere in Android. Most of the time it's located in /data/data/ I was lucky and found it in a search through Titanium Backups' tarballs. Nab that file. It has everything in it in a sql database.

I then found this excellent script to extract and convert all contacts into a .vcf format for easy importing into the next device. It's located here on Github and requires two dependencies (on an Ubuntu 12.04 machine in which it was written for): sqllite3 and libsqllite3-dev:

sudo apt-get install sqlite3 libsqlite3-dev

After dependencies are satisfied, save the script on Github as Mark it as executable:

chmod +x

use the script like this:

./ contacts2.db > contacts2.vcf

You will then have a lovely .vcf file for easy importing into your phone.

share|improve this answer
Chauncellor, your solution worked like a charm! Thanks for this! Also works on Mac too, just download the sqlite 3 here, place all files (sqlite3, contacts2.db and the script) on the same folder and run the script. Pure magic! haha – user29432 Mar 3 '13 at 7:58
for people with Homebrew installed, brew install sqlite3 can be used – Eric Hu Mar 6 '13 at 5:47
Many Thanks, this was exactly what I wanted. :) – DRS David Soft Oct 4 '15 at 23:10

For those who don't use dd, AppExtractor supports importing contacts from a Nandroid backup.

share|improve this answer

protected by Community Jan 10 '14 at 20:52

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.