I need to hand in my old phone, but before I do, I want to be sure I am not going to lose any data, including app data.

I've tried the usual adb backup -apk -shared -all, however this produced a file that is a little under 9 GiB. The device capacity is 64 G and is almost full. Also, I made a backup about five months ago that is a much more plausible 45 GiB. Alas, I don't recall what command I used five months ago. (More specifically, I don't remember what arguments; I'm 99% certain it was some invocation of adb backup.)

What am I doing wrong? How can I back up "everything"? (I don't need e.g. OS stuff, but I definitely have more than 9 GiB of pictures, user-installed apps, and such.)

  • First adb backup only includes private app data. What is stored inside /sdcard is not included. Additionally apps can limit or even totally deny backup. In such a case adb backup will miss some data or whole apps. Some apps may provide a app internal functionality to backup data.
    – Robert
    Dec 24 '20 at 21:03
  • @Robert, then how did I previously manage to create a 45 GiB backup? I don't have that many apps. Also, I'm aware of apps not allowing backup and am almost certain that's not the issue I'm having.
    – Matthew
    Dec 24 '20 at 21:10
  • 1
    @Robert that's not quite correct. The -shared parameter advises it to also include "shared data", i.e. SD card contents. // Matthew: apps can opt-out of backup, so with one monolitic file you never know what you get. Take a look at my tool Adebar, which a.o. creates a script to backup each app separately (so you see which fail) and optionally also shared storage (though that you could backup simpler by simply copying all its files). The script will already show which apps won't backup, just look inside once it is created.
    – Izzy
    Dec 24 '20 at 21:31
  • 1
    depending on how old the phone is it may exploitable. the adb backup arguments are easy to figure out. Be aware not all flags are fully implemented, behavior may differ from expectation. But if your previous backup.ab was +36 GB bigger that sounds more like lost connection. for pictures i recommend 'adb pull -a /sdcard'
    – alecxs
    Dec 24 '20 at 22:57
  • @alecxs, is there absolutely no error reporting if the connection is dropped? If that's the case, that may well be what happened...
    – Matthew
    Dec 25 '20 at 1:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.