FORUMS
Remove All Ads from XDA

[ROOT] Manually backup/restore call history, text messages and contacts

1,941 posts
Thanks Meter: 194
 
By askpcguy, Senior Member on 25th February 2011, 08:38 PM
Post Reply Email Thread
I been performing this myself with great success, but you need ROOT access AND busybox installed. Create a folder on your phone's SD card called tmp. You'll need adb in order to adb shell, and gain root access. (in cmd, adb shell <enter> su <enter> confirm you are on a # prompt not the $ prompt)

Now copy and paste each line, press enter after each line pasted. Confirm the files copied after each line by running ls /mnt/sdcard/tmp/mmssms.db
Code:
cp /dbdata/databases/com.android.providers.contacts/contacts2.db /mnt/sdcard/tmp/contacts2.db
cp /dbdata/databases/com.android.providers.telephony/mmssms.db /mnt/sdcard/tmp/mmssms.db
cp /dbdata/databases/com.sec.android.provider.logsprovider/logs.db /mnt/sdcard/tmp/logs.db
cp /dbdata/databases/com.sec.android.app.memo/Memo.db /mnt/sdcard/tmp/Memo.db
cp /dbdata/databases/com.android.providers.calendar/calendar.db /mnt/sdcard/tmp/calendar.db
Once that is done, mount the phone to your computer and copy the TMP folder to your computer. When you flash the custom rom, you'll have to keep the SIM card out of the phone because you do not want new history items written to the log files.

Next ls -l /dbdata/databases/com.android.providers.contacts/contacts2.db (and the others) to see what permissions/owner they have, if you simply cp the files from /mnt/sdcard/tmp to their locations, you'll get force closes in the application (because it's not able to write log data).

Make note is the owner for each db file. Then back to adb shell, su, cd /mnt/sdcard/tmp (trust everyone knows to copy the tmp folder from PC onto your phone) cp contacts2.db /dbdata/databases/com.android.providers.contacts/contacts2.db (and the others!).

Once the files are copied back to their locations on the device, run the following:
Code:
chmod 660 /dbdata/databases/com.android.providers.contacts/contacts2.db
chown app_15.app_15 /dbdata/databases/com.android.providers.contacts/contacts2.db
Obviously you want to use the app_X.app_X you saw from running ls -l /path/filename before copying the backed up log file.

Quote:
Originally Posted by bravomail

This is quick comparative review.

Overall for KB1.
TiBu restore of system setting from JS32.2.1 or JS52.2.1 other than WiFi highly discouraged. I had uncurable Force Close for Browser and for MMS. Say g-bye to your messaging history, or find other ways of transferring it.

Original thread is here http://forum.xda-developers.com/showthread.php?t=969343
The Following 7 Users Say Thank You to askpcguy For This Useful Post: [ View ] Gift askpcguy Ad-Free
 
 
25th February 2011, 09:31 PM |#2  
Senior Member
Flag Austin
Thanks Meter: 24
 
More
SMS Backup and Restore is a great app that does exactly what it's title indicates, without root.

https://market.android.com/details?i...SBackupRestore

Call logs backup and restore also does exactly what it's title indicates, without root.

https://market.android.com/details?i...gBackupRestore

Both free and developed by the same guy, I've used both many times without a hitch.

I sync my contacts with gmail, so no problem there.
The Following User Says Thank You to hauj0bb For This Useful Post: [ View ] Gift hauj0bb Ad-Free
25th February 2011, 09:33 PM |#3  
Senior Member
Thanks Meter: 75
 
More
Thumbs up
Quote:
Originally Posted by hauj0bb

SMS Backup and Restore is a great app that does exactly what it's title indicates, without root.

https://market.android.com/details?i...SBackupRestore

Call logs backup and restore also does exactly what it's title indicates, without root.

https://market.android.com/details?i...gBackupRestore

Both free and developed by the same guy, I've used both many times without a hitch.

I sync my contacts with gmail, so no problem there.

+1

The manual method is pointless and extra work for nothing. These apps work flawlessly. I've used them many times as well.
25th February 2011, 10:05 PM |#4  
OP Senior Member
Thanks Meter: 194
 
More
I know there are apps which backup the same settings, my whole point for posting is I do not backup contacts with Google. So I kept trying different things until putting this together and I know it's a pain but all that really is done is copying and pasting lines into an SU adb shell.
The Following User Says Thank You to askpcguy For This Useful Post: [ View ] Gift askpcguy Ad-Free
27th February 2011, 02:06 AM |#5  
Junior Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by askpcguy

I know there are apps which backup the same settings, my whole point for posting is I do not backup contacts with Google. So I kept trying different things until putting this together and I know it's a pain but all that really is done is copying and pasting lines into an SU adb shell.

You do not use google account or you just don't use it for backing up contacts...
27th February 2011, 03:15 AM |#6  
OP Senior Member
Thanks Meter: 194
 
More
I use a Google account but not to sync or backup contacts.

Sent from my SAMSUNG-SGH-I897 using XDA App
27th February 2011, 03:31 AM |#7  
bravomail's Avatar
Senior Member
Flag Detroit
Thanks Meter: 347
 
More
Thanks for good info!
Thanks for good info!

I personally don't care about my SMS history. Other people text a lot.

Another alternative is to use Google backup/synchronization. I never tried it. Anyone?
7th March 2011, 10:00 PM |#8  
Junior Member
Thanks Meter: 0
 
More
In my experience, backing up phone contacts using Gmail syncing is not 100%. Some fields in the on phone contact records are not properly carried into Gmail contact records and viceversa.

You'd think since Android is Google and Gmail is Google this would work flawlessly.
8th March 2011, 01:34 AM |#9  
pietro_spina's Avatar
Senior Member
Western MA
Thanks Meter: 21
 
More
Quote:
Originally Posted by askpcguy

I been performing this myself with great success, but you need ROOT access AND busybox installed. Create a folder on your phone's SD card called tmp. You'll need adb in order to adb shell, and gain root access. (in cmd, adb shell <enter> su <enter> confirm you are on a # prompt not the $ prompt)

Now copy and paste each line, press enter after each line pasted. Confirm the files copied after each line by running ls /mnt/sdcard/tmp/mmssms.db
[CODE]
Next ls -l /dbdata/databases/com.android.providers.contacts/contacts2.db (and the others) to see what permissions/owner they have, if you simply cp the files from /mnt/sdcard/tmp to their locations, you'll get force closes in the application (because it's not able to write log data).

Make note is the owner for each db file. Then back to adb shell, su, cd /mnt/sdcard/tmp (trust everyone knows to copy the tmp folder from PC onto your phone) cp contacts2.db /dbdata/databases/com.android.providers.contacts/contacts2.db (and the others!).

Once the files are copied back to their locations on the device, run the following:

Code:
chmod 660 /dbdata/databases/com.android.providers.contacts/contacts2.db
chown app_15.app_15 /dbdata/databases/com.android.providers.contacts/contacts2.db
Obviously you want to use the app_X.app_X you saw from running ls -l /path/filename before copying the backed up log file.

Are you doing all this above because
Code:
cp -p
failed to preserve attributes or something? Or do your fingers like the exercise...

Oh, I bet it's because it is that the attributes are getting scrubbed when they are copied off the device to your computer...
8th March 2011, 02:30 AM |#10  
OP Senior Member
Thanks Meter: 194
 
More
I only do this manual method because I want to retain my history and contacts between Roms.

Sent from my SAMSUNG-SGH-I897 using XDA App
8th March 2011, 03:10 AM |#11  
pietro_spina's Avatar
Senior Member
Western MA
Thanks Meter: 21
 
More
I was asking specifically why you didn't use the "-p" preserve attributes flag when using the cp (copy) command. But I now realize your may be storing your backups in a way that blows away the info anyway. so you need to set ownership and permissions manually after restore..
Post Reply Subscribe to Thread

Tags
call history, manual backup, text messages

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes