Backing Up Android Contacts

I couldn’t find any Free Software to back up my Android phone contacts list. After some stumbling around and reading a ton of instructions (none of which got me where I needed to go), I came up with a simple way to do it by hand.

Use adb shell to get to the phone, then do “su” followed by “dd if=/data/data/com.android.providers.contacts/databases/contacts.db of=/sdcard/contacts.db”.

That will put your contacts on your sdcard, where you can adb pull it with “adb pull /sdcard/contacts.db”.

Replace ‘pull’ with ‘push’ to put contacts on the sdcard, then replace if and of in the dd command to put the db back in the dir where the phone expects it.

The whole thing should be rather easily scriptable if you’re so inclined.

RSS feed | Trackback URI

5 Comments »

Comment by Luis
2010-03-04 10:23:12

If you’re OK with syncing them to the great cloud in the sky, ISTR wget works fine to grab CSV out of gmail.

 
Comment by James Vasile
2010-03-10 16:10:25

The whole point of doing it myself is to keep the data off of Google’s servers. Their recent mishap with mapping social networks is a good example of the kind of harm I’m trying to avoid.

 
Comment by Ron
2010-03-12 05:33:06

dd has never been the proper too for doing backups. Isn’t there a “cp”?

 
Comment by James Vasile
2010-03-12 10:49:40

Anroid/Linux is not the same as GNU/Linux (which is why RMS is right that we should be using the full names to distinguish them). The various GNU pieces that we all assume come with Linux installs are missing, so unless you’ve gone to the considerable difficulty of installing busybox, there is no cp.

 
Comment by Eric
2010-05-02 23:45:31

If you dislike dd, there is cat.

cat /data/com.android.providers.contacts/databases/contacts.db > /sdcard/contacts.db

 
Name (required)
E-mail (required - never shown publicly)
URI
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.

Trackback responses to this post