Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Android SMS backup/restore w/ adb
adb remount
adb pull /data/data/ mmssms.db
adb remount
adb push mmssms.db /data/data/

This comment has been minimized.

Copy link

porg commented Oct 17, 2013

I hope you perceive my comment as on topic.

I want to rely solely on local backups and no cloud backups, and not achieve this with custom recoveries (physical security loophole) such as CWM, etc.

I noticed that on stock Android 4.3 adb backup -apk -all -system -f /path/to/my/backup.ab is all but complete! All 3rd party apps are properly backed up and restored, but sms, call log and contacts, practically all basic phone features, are NOT backed up!

Then I tried CyanogenMod and set Settings > Developer options > Root Access (duplicate entry also under: Settings > System > Superuser > Settings > Superuser Access) to "Apps and ADB".
Then tried your command line, which failed with:
failed to copy '/data/data/' to '/my/path': Permission denied

Obviously "Root access to ADB" means something else (what???) but not "Run ADB as Root".
To run the adb deamon on the Android device as root can be achieved by adb insecure.
Then I could pull and push properly! After the push, the sms app still showed the for test purposes intentionally emptied state, but after a restart (of the app or the whole system), it showed the proper restored state.


This comment has been minimized.

Copy link

suamikim commented Feb 4, 2015

This works fine for sms and text in mms but it doesn't seem to backup photos/pictures sent via mms.
I'd really appreciate instructions on how to also backup photos & pictures from mms.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.