Adb backup, starts but doesn't save anything

Hi Fairphoners,

looking forward to do the 1.8.5. update i tried to do a full backup with adb backup and got a little problem and therefore now this question.

-adb device: shows my FP1
-adb backup starts (on my ubuntu 14.04 terminal) and on the FP1 it asks for a password …

  • it doesn’t matter if i put a password or not, it shows after a few seconds, the message “Sicherung abgeschlossen/ backup finished”
  • in my pc folder (default setting without path or with -f /home/backup/file.ba) it is only a zero byte file, saying “nothing”

Can someone tell me, where to check for the reason ?

Thanks…

Does the phone go to stand by (turn of the screen)? Maybe ticking “Stay Awake” in the Developer settings helps?

No. The message “Datensicherung abgeschlossen” comes after a few seconds. No lockscreen, no standby or something like that.

What happens if you type adb root before you try to backup?

I have the same problem here. adb root gives me
"adbd cannot run as root in production builds"

Can anyone help?

You need to Google that. I had that too, some time ago and can’t remember how I solved it, but there are tutorials on the internet. If you find a useful one, I would be delighted, if you’d post it here. :blush:

What is the exact command you are using? (including all command line options, etc)

Have you read the corresponding help entry?

  adb backup [-f <file>] [-apk|-noapk] [-shared|-noshared] [-all] [-system|-nosystem] [<packages...>]
                               - write an archive of the device's data to <file>.
                                 If no -f option is supplied then the data is written
                                 to "backup.ab" in the current directory.
                                 (-apk|-noapk enable/disable backup of the .apks themselves
                                    in the archive; the default is noapk.)
                                 (-shared|-noshared enable/disable backup of the device's
                                    shared storage / SD card contents; the default is noshared.)
                                 (-all means to back up all installed applications)
                                 (-system|-nosystem toggles whether -all automatically includes
                                    system applications; the default is to include system apps)
                                 (<packages...> is the list of applications to be backed up.  If
                                    the -all or -shared flags are passed, then the package
                                    list is optional.  Applications explicitly given on the
                                    command line will be included even if -nosystem would
                                    ordinarily cause them to be omitted.)

If you want to backup your entire Fairphone you will probably need something like
adb backup -f backup-file.ab -apk -shared -all -system
(Disclaimer: I have not tried this myself yet) This works on my computer (Ubuntu 15.04). I have to insert my encryption password on the phone, and then it backs up.

btw: @longman, were you able to solve your problem? Maybe your solution also helps @mary_k

1 Like

Sorry for the late response.

No i didn’t solve the Problem and used only the manual way, with copy, export, and so on…

Just for the record if other people will look this up

Normal adb backup

$ adb backup -all -apk -shared -f foo.ab

And also set a password in the backup settings.

Make sure you the device is found, the password is set and the “backup” dialog shows up!

The backup “dialog” can be see in the xda forum link.

Rooted adb backup

You can get adbd run as root with an app like this or just exchange the adbd binary with one that does not give up root privileges.

It would work like this: Get the right binary** on a sd card. Open a shell, backup the old adbd with mv and relplace it with the the new one. Kill the running old adbd, restart the new one.

(**I think the FP project should provide the right binary and a howto with warnings for people that want to do their own full backup without any extra apps, else you depend on strange adbds from the web.)

If adbd runs as root you could do stuff like backup’ing mms/sms (tested here).

$ adb pull /data/data/com.android.providers.telephony/databases/mmssms.db

Checking a backup
To check what is inside an ab file without having to install it, create a tarball and unpack it.


$ java -jar abe-all.jar unpack foo.ab /tmp/foo.tar

The old FAQ about "backups. Needs some love … maybe someone can update it?
Here is the FP FAQ about "backups"

I had the same problem (“backup started”, then “backup finished” after about a second, backup file size < 1kb).

I solved it by using an older adb version I still had lying around. I think I got it from http://dl.google.com/android/adt/adt-bundle-linux-x86_64-20130219.zip, but that is 404 now. Search for “adt-bundle-linux-x86_64-20130219.zip” to find a mirror.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.