backing up android device using adb

76,398

Solution 1

Execute on your computer

adb backup -apk -shared -all

This should hopefully create backup.ab with all of your apps, OS, and data. To restore, execute the following.

adb restore backup.ab

Solution 2

If you do not have root access on tablet1, certain data will not be accessible by adb, such as private application data, hence they will not be backed up. Try running 'adb root' first.

Share:
76,398
epocolis
Author by

epocolis

Updated on January 15, 2020

Comments

  • epocolis
    epocolis over 4 years

    I am attempting to copy all the applications and data from a android tablet1 to another android tablet2. Both tablets has the same specification and is the same type.

    My approach is to use the command

     adb backup -f my_backup.ab -apk -shared -all
    

    to get all the files from tablet1 then use the command:

     adb restore my_backup.ab
    

    to restore(basically copy) all the backed up files to tablet2.

    The restore works fine, my problem is that sometimes backup does not backup all applications are all data on the device.

    Do you have any idea why this might be happening?

    Thanks for your response and time.

  • VCD
    VCD over 10 years
    It looks like the restore command is wrong. For Windows users there is no sudo command to use so I would rather revise the backup command too.
  • Lord_JABA
    Lord_JABA over 10 years
    if you want to be sure that all data is baked up first run adb root
  • BrainSlugs83
    BrainSlugs83 about 10 years
    also, you might want to include -system. It will bloat the backup, but it just depends on how deeply the the device needs to be "cloned".
  • Simon
    Simon about 10 years
    -system is probably unnecessary because the default is -system already
  • Connel
    Connel almost 10 years
    I have just got a replacement phone and want to transfer everything over from my old one to my new one. My current device has an unlocked bootloader, is running a custom Google Edition ROM, is 's-off'ed (HTC One M7) and rooted. How much of this will be transferred across?
  • Peter Teoh
    Peter Teoh over 9 years
  • AminM
    AminM almost 9 years
    what about whole phone/tablet ROM?can do this with adb?
  • Cadoiz
    Cadoiz about 3 years
    I think, you mean the correct thing. Check out this brilliant answer by Izzy android.stackexchange.com/a/182384/340401