Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

In attempt to install 2.2 I've deleted all my contacts(contacts were saved on phone, not as google contacts)
I've done full nandroid backup while phone still had those contacts; however when I try restoring image; I get bootloop.
Nandroid backup contains system.img, data.img, cache.img and boot.img;

I'm wondering if I can restore only data.img to get contacts back.

I have thought of 2 other solutions:

a) make a new nandroid image of current status; verify that it's ok by doing restart; then open copy database with contacts from one backup to another.

b) open database with contacts from data.img; and manually retype 200 phone records.

Is there any smarter (quicker, easier) way??

share|improve this question

5 Answers 5

up vote 5 down vote accepted

Clockworkmod recovery has an 'Advanced Restore' option that allows you to pick just one of the following partitions: boot system data cache sd-ext

If you don't already have it, download ROM Manager from the market and this will help you install the clockworkmod recover.

(I've no idea whether this will solve your problem, but yes you can restore the data partition! ;) )

share|improve this answer
    
thanks, I'll give it a try and post result –  bbaja42 Apr 2 '11 at 8:59
    
works :D ,thanks –  bbaja42 Apr 2 '11 at 16:10

Mount the image in your computer (Linux) or phone, extract the contacts database, and copy it over the contacts database in the phone. You do this using a loopback device, e.g. mount -o loop /sdcard/myimage.img myimage. "myimage" is where you can view the contents afterward. The database should be data/data/com.android.providers.contacts/databases/contacts.db.

You can restore the data for a single app by copying the relevant folder in /data/data/.

share|improve this answer

I couldn't mount data.img via mount -o loop :( Also restoring old data.img resulted in Android phone being stuck at Cyanogen logo screen and not loading Android OS fully :(

I managed to extract contacts from old backup by doing this:

  1. Install the Android SDK

  2. Boot into recovery mode

  3. Make full backup of your current system via Nandroid backup

  4. Restore /data partion of your old backup

  5. Boot into recovery mode

  6. Start adb server:

for Fedora
   $ su -
   # cd ~/android-sdk/tools
   # ./adb kill-server ./adb start-server
OR for Ubuntu
   $ sudo su
   # cd ~/android-sdk/tools
   # ./adb kill-server ./adb start-server
  1. Connect to your Android phone via adb SDK command

    ./adb shell

  2. Mount /data and /sdcard partition via Recovery menu on your phone

  3. Copy contacts from your old /data partition to your /sdcard partition

   # cp /data/data/com.android.providers.contacts/databases/contacts2.db /sdcard/contacts2.db.old
  1. Unmount /data partition

  2. Format /data partition

  3. Restore your current /data partition from backup image

  4. Backup your current contacts database

    # cp /data/data/com.android.providers.contacts/databases/contacts2.db /sdcard/contacts2.db.current
  1. Copy your old contacts over your current one
    # cp /sdcard/contacts2.db.old /data/data/com.android.providers.contacts/databases/contacts2.db
share|improve this answer

You can use unyaffs to decompress a backup image, and then access the data directly. Here's a guide on how to do so.

share|improve this answer
    
I didn't think of unyaffs here, good call. I added a good guide I found for it. –  Matthew Read Aug 10 '11 at 20:24

There are also several apps available helping with a partial Nandroid restore:

They all give you the opportunity to extract parts of your Nandroid backup: Apps and their data, SMS, etc., and make the procedure a little easier.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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