Backup and restore SMS and MMS via Android ADB

There are apps to be able to backup and restore SMS and MMS from and to your phone. But the backup restore procedure can also be done by using Android Debug Bridge. This is a very good solution if your screen or something else is broken on your phone so that you cannot use any backup app.

The SMS and MMS database is located in the file mmssms.db in /data/data/com.android.providers.telephony/databases on your phone. To copy mmssms.db from your Android phone and then paste it to you phone, it needs to be rooted.

But what about the MMS images and pictures? I you only backup the mmssms.db file with ADB your MMS pictures will be lost. If you open you mmssms.db file in an SQLite browser you can see where your images are saved on your device. On the devices that we have looked into the pictures are saved in /data/data/com.android.providers.telephony/app_parts/

Backup and restore SMS and MMS via Android ADB – The steps

ADB backups can be made when the phone is booted into Android or in recovery. Restore shall be made when the phone is booted into Android.

  1. Get access to your phone as root:
    adb root
  2. Backup the SMS and MMS database from your phone:
    adb pull /data/data/com.android.providers.telephony/databases/mmssms.db
  3. Backup the MMS images from your phone:
    adb pull /data/data/com.android.providers.telephony/app_parts/
  4. Restore the SMS and MMS database to your phone:
    adb push mmssms.db /data/data/com.android.providers.telephony/databases/
  5. Make sure that the folder app_parts exists in /data/data/com.android.providers.telephony/databases/. Otherwise create it using:
    adb shell mkdir /data/data/com.android.providers.telephony/app_parts/
  6. Restore the MMS images to your phone (if your images are saved in the folder app_parts on you PC):
    adb push app_parts /data/data/com.android.providers.telephony/app_parts/

Restart the phone you restored you SMS and MMS to and your SMS and MMS should be restored.