Here's how you can (try to) restore your contacts manually. (NOTE: I'm assuming a little bit of Linux knowledge. I've tried to cover the things that are hard to look up, but little else.)
First, enable USB debugging mode, and plug your phone into your computer. Then,
- Find the folder that contains your backups. By default, I think this is something like
/sdcard/TitaniumBackup. If you used a custom location (e.g., to store backups on an external SD card), then it should be easy to find.
- There should be a gzipped tarball with a name similar to
com.android.providers.contacts-<date>.tar.gz. Copy it to your computer with
- Untar the file you just pulled. There should now be a folder called
data. Descend into
data/data/com.android.providers.contacts/databases/. There you will find
adb push to upload these to your phone. (Note: You will probably have to push them to a location that does not require root access.)
(For the next steps, you may want to reboot into recovery mode, to make sure that your phone is not using your contacts database. You can do this easily using
adb reboot recovery.)
- Start a shell with adb again, and escalate to root using
- Copy the files you pushed to
/data/data/com.android.providers.contacts/databases/, so that they replace the ones you just renamed.
- Make sure your new files have the same permissions as the old ones. Check the permissions of
ls -l, and change the perms of your files with
chown. Check the SELinux labels with
ls -Z, and change them if needed with
chcon <full label> <file>.
- Reboot and see if it worked.
I hope this method works for you. I must admit, that when I tried it, CyanogenMod immediately reverted my changes (such that
contacts2.db matched the original
contacts2.db.cm). If this method does not work, and you really want to use CyanogenMod, then you can still recover the data from
contacts2.db and try to add all of your contacts by hand.
- Your phone numbers are in the table named
phone_lookup, and display names can be retrieved from the table named
raw_contacts. You can see (at least some of) your contacts by running
select raw_contacts.display_name, phone_lookup.normalized_number from raw_contacts
inner join phone_lookup on raw_contacts._id = phone_lookup.raw_contact_id;