yashsingh1/xdaforums huggingface dataset:
[Samsung Galaxy Nexus] styleprince923:
Hi Kevin,

Thanks so much for this guide! I literally just created an account as I have an urgent question regarding this topic;

I'm using Minimal ADB and Fastboot, which shouldn't be a problem and have the latest drivers for my S8 SM-G950FD. The command line reads once i open the program:

C:\Program Files (x86)\Minimal ADB and Fastboot>

Now, here is the command line I was told to type by someone;

adb backup -apk -obb -shared -all -system -f backup_

Once i type that, i get a prompt on my phone and i select back up now. Great, it looks like it is working! However, just a couple of minutes later, my phone goes to the home screen, stopping the backing up process! I'm aiming of literally backing up everything and a friend on the Termux reddit told me to do this, but i'm stuck now :(. Help please!!

P.S. Can you also tell me how to locate a backup once successfully completed in the right directory and how to restore it successfully to my android phone, after i root my S8? Thanks dude! :D

P.P.S. Here is an image that can help bigtime with this issue (I don't get any of it, i just need to know how to backup and restore data successfully lol)!

P.P.P.S Checked in the relevant directory. Still nothing! See images below:

UPDATE: I did it! Just typed :

adb backup -apk -obb -shared -all -system -f C:\Users\amirk\Documents\backup.ab

The file is called backup.ab and is 215,751kb.

To restore it (I think):

adb restore C:\Users\amirk\Documents\backup.ab
[Samsung Galaxy Nexus] pipoawas:
ADB isn't recommended for full or system backups, it has the switches to do so, but it's buggy (or it was recently). I recommend a nandroid backup, or Swift Backup.
[Samsung Galaxy Nexus] sdkyron:
So, does Swift Backup allow for a full phone backup ?

I often switch froms, try stuff that doesn't always work and i would like a guaranteed way to make a full phone backup, not just apps and setting, i mean the whole phone system.
[Samsung Galaxy Nexus] pipoawas:
No, I'm afraid it doesn't, just apps (with every external data, obbs, etc they may have, but only apps). Y mentioned in case you could do without the system backups but wanted all your apps as you have them currently. For full system backups, you want nandroids, period.
[Samsung Galaxy Nexus] 78t140@broadstripe.net:
This works Kevin , I backup using an app called migrate 4.0 you can get it on APKPure or now on playstore it backs up everything including passwords to you apps and apks or just the way you sign in using fingerprint it literally clones everything , I use an otg cable to my 3.0 64gb thumb drive to backup then put the backup file on my PC so if I want to reuse thumb drive for other things I got a copy that I can use on multiple phones even my tablet . Or anyone can backup onto an SD chip then move it back to sane phone once changing roms or if you ever have to do a factory reset always good to keep a full backup of literally everything .
[Samsung Galaxy Nexus] GCalzo:
Unfortunately this app needs root access for restore... this thread is called Full Phone Backup without Unlock or Root
[Samsung Galaxy Nexus] Skorpion96:
is possible with restore option to restore an update.zip package into cache partition (i want to load a package here because i can't unlock bootloader and mtk-su won't work) and then do a install update after reboot of phone? if yes how can i create ab file to restore it?
[Samsung Galaxy Nexus] mrrocketdog:
thanks for some good info. :)
[Samsung Galaxy Nexus] karl615:
You're missing a command, it's

prompt$ adb shell bu backup -apk -blahblah

See, you're missing the 'bu', there's bu backup and bu restore...
[Samsung Galaxy Nexus] Cr4z33:
I would like to use adb restore in WSA for Windows 11, but as it doesn't have wireless debug working (you can't enable the toggle in the Android settings) I dunno how.

Any other method working?
[Samsung Galaxy Nexus] DonDizzurp:
Same question here. Did you try it? Did it work?

Using Android 12 on a Samsung s10+. I'm unrooted so I don't have TWRP to make a full backup image.

Any idea if this method is still valid?
[Samsung Galaxy Nexus] DeputyStankus:
I'm looking for similar info. I have an LG V20 on stock Android 8.0, unrooted, and I'm trying to backup some apps' data. I used Helium backup when I transferred to this device from another LG V20 (switched carriers), but now it doesn't seem to work. It just freezes as soon as I start the backup. Even if it did work, there are several apps that say "backup disallowed," even though I backed up those same apps and transferred them when I switched to this one.

I'm a complete noob with ADB, and I'm struggling to understand the instructions for using this to backup just the data from specific apps instead of the whole phone. It's enough of a struggle that I'd appreciate someone confirming it even still works before I waste anymore time.

If anyone has a link with simpler (liked ADB for Complete Idiots version) instructions on how to backup/transfer only the app save data and only from specific apps, I would really be grateful!
[Samsung Galaxy Nexus] 0ldsoul:
If you're staying stock. LG V20 has LG backup app. Its's like TB without root. You can restore data using that app.
[Samsung Galaxy Nexus] DeputyStankus:
I didn't realize it could do app data. However, I'm trying to transfer the data to a non-LG phone. Even though I installed the LG backup on the new phone, it won't let me restore. Any idea how to make that work?
[Samsung Galaxy Nexus] 0ldsoul:
No luck. LG Restore only works between LG devices. The only thing that worked for me is Helium and that is 50/50 too. The lower the Android version the better it works. It seems to have stopped working on A13.
[Samsung Galaxy Nexus] vindicatorr:
I've been searching on the `bu` topic since I first encountered its existence today. In short, I'm not liking it.

First you have to

$ bmgr --user <#> activate true

or logcat shows it just crashes.

Second, the `-h` help parameter mentions the `-f` output file parameter (which is said to also default to `backup.adb`), but it isn't respected. The output is still sent the console output, which you'd just do a simple `>` redirect.

Third, the `-user <#>` parameter doesn't seem to work right for secondary users. It'll put the prompt on the primary user screen, and when you press the button to backup, it does nothing and logcat shows `bu` just timeout.

I guess I'll just continue exploring `bmgr` with `com.android.localtransport/.LocalTransport` or `com.google.android.gms/.backup.migrate.service.D2dTransport` (when I want to do device2device transfers).

It's all just an unnecessarily convoluted mess to backup/restore without needing the cloud or special apps/transports.

I'm guessing `bu` is being sent to pasture, and maybe forgotten to just be removed altogether in the latest android versions.
[Samsung Galaxy Nexus] AntonyMan:
Keep in mind, that in Windows OS:

1. The Drive[C] always followed by semicolon[:] and a backslash[\].

example: C:\

2. When any of either Path or File name includes spaces, surround the address into double quotes ["]. [C:\Backups\backup.ap]

(I recommend to always surround paths in double quotes, whether or not includes spaces.)

example: "C:\All Backups\backup 20230717(Redmi7).ab"

3. Address is not case sensitive. C:\ or c:\ is the same.

In your case, there are typo errors.

The correct is: adb backup -f "c:/backup.ab" -apk -shared -all

Use the command options/switches in order of priority:

adb backup [-f <file>] [-apk|-noapk] [-shared|-noshared] [-all] [-system|nosystem] [<packages...>]
[Samsung Galaxy Nexus] m0han:
I'm trying to copy the FULL contents of the internal storage of a phone (about 60 GB - see screenshot) to a PC's HDD/SSD. I want to (i) do a 'Factory Reset' / 'Format Data', (ii) install a new OS and then (iii) copy everything back to the phone. The phone is not rooted.

Can the above commands do that? If the commands are to be modified, I'd appreciate if someone tells me how.
[Samsung Galaxy Nexus] tor111:
for samsung devices as of 2024, there is an official application called smart switch which has a feature that creates a full device backup onto an sd card, then after bootloader unlock can just install said application and restore from the sd card. passwords can't be applied though, if someone finds your sd card they could get all your data.
[Samsung Galaxy Nexus] copkay:
It will still be wiped, you'll just be restoring most of the data afterwards.
[Samsung Galaxy Nexus] Hipe0ples555:
And the bootloader will still be unlocked when i restore?? I know its a dumb question but i just want to make sure!!
[Samsung Galaxy Nexus] copkay:
Yep.
[Samsung Galaxy Nexus] Hipe0ples555:
Final question, anybody know the commands for a mac?
[Samsung Galaxy Nexus] sonnendieb:
Hey guys,

Thanks for the nice tutorial. I seem to have a strange problem. I am unable to backup because the back up my data button does not seem to work. I can't click it. I can click on do not back up... Great. ^^

I've added a password in the developer options and added the same in the backup dialogue. No change.

Any idea where the problem could be?
[Samsung Galaxy Nexus] copkay:
Is the button greyed out? Or just not responding?
[Samsung Galaxy Nexus] sonnendieb:
It's just not responding.

adb backup -apk -shared -all -system -f /c/backup/backup1.ab

Thats the command I used.
[Samsung Galaxy Nexus] copkay:
And you're absolutely sure you're entering the same password in both Developer Options and the Backup screen? If so, reboot and try again.
[Samsung Galaxy Nexus] sonnendieb:
Yeah, I'm absolutely sure. I just changed it, rebooted and tried again, just to make extra sure. But nothing happens.

Btw: Don't think thats important but the SDK usb drivers did not work for me, had to use the Samsung drivers. Oh and my handset is set to German, but again, that should not be a problem.
[Samsung Galaxy Nexus] copkay:
Yeah, I doubt that's the issue if it's still receiving the command... If you press the backup button, does it flash as though it's been pressed and nothing happens, or does nothing happen visually at all?

You wouldn't happen to be running the Screen Filter app, would you?
[Samsung Galaxy Nexus] NCguy:
What's up with the screen filter app?
[Samsung Galaxy Nexus] copkay:
There's a known glitch with that app that, while running, you can't install an app from the Amazon Appstore (the install button is not responsive). I haven't used it on my Nexus -- the screen gets plenty dark enough compared to my Fascinate -- but it could be a similar issue. Grasping at straws. :)
[Samsung Galaxy Nexus] sonnendieb:
Nope, dont have that app. I checked all my apps and the only thing I could think of was Theft Aware or now Avast!

The button does not flash, it's as if it wasn't a button at all. I remeber that I had a similar problem with my old HTC Sensation once. I could not install apps not from the market (although I had allowed this). If you clicked on install, the button did not react at all too.

Okay: I switched off Theft Aware. Now the button seems to work. It flashes after having been pressed. And there is a new folder on my system disc. At the mo its 0kb, but I guess the whole thing is still in process. Is there any way to check if its still working or how long it will take or when it is finished?

Edit 2: Oh dear, I was too fast. Nothing happened for quite a while. I tried to delete the backup folder to see if it was being written in. No problem, nothing has been written on my computer. Plus the button on the phone is not reacting once more...
[Samsung Galaxy Nexus] copkay:
After you pressed backup and it worked, did you see the package names of your installed applications display one at a time in between the button and text? And did you get a Toast saying "Backup Started"?

I would switch off or temporarily remove any monitoring apps or services such as anti-virus (which I personally believe are completely unnecessary) and then try again.

Failing that, try starting in safe mode and see if it works then.
[Samsung Galaxy Nexus] sonnendieb:
I did get the toast, I did not see any names, no. The window just disappeared. And nothing else happened.

Just started the safe mode, it seems to be backing up. ^^ Does it backup everything in safe mode?
[Samsung Galaxy Nexus] copkay:
I'm not sure. Safe Mode disables all third party applications, so it might not be backing any of them up. The fact that it works in Safe Mode tells me that an application you have installed is interfering with the backup process, though.

If you don't see any of your third party app package names displayed during the backup process, then it isn't backing them up (and I don't expect that it will, to be honest). Boot back up in normal mode, and try uninstalling your AV and anti-theft apps, and try again. You may just have to go through your apps one at a time, and see if you can find which app is misbehaving.
[Samsung Galaxy Nexus] NCguy:
Happen while invoked or just installed? Im not using amazon at the moment but i do have screen filter on my GN. I haven't detected any other issues with it so far.
[Samsung Galaxy Nexus] copkay:
Just while invoked, no problems with it turned off.
[Samsung Galaxy Nexus] sonnendieb:
Hey guys,

just to let you know: Backup in safe mode backsup all app data. Everything worked out fine (except for photos). :)

Thanks copkay for the great help. Really appreciate it!
[Samsung Galaxy Nexus] Hipe0ples555:
Mac

Fully working on mac (i think). If anyone wants commands, let me know!
[Samsung Galaxy Nexus] Naumoff42:
Yes please!
[Samsung Galaxy Nexus] Hipe0ples555:
http://xdaforums.com/showthread.php?t=1436846
[Samsung Galaxy Nexus] bairdi:
I created a simple DOS batch script to pull the media contents and then do a adb backup.

echo off

SET Today=%Date: =0%

SET Year=%Today:~-4%

SET Month=%Today:~-10,2%

SET Day=%Today:~-7,2%

SET DateString=%Year%%Month%%Day%

echo on

adb pull /data/media/ ./%DateString%Media/

ECHO Allow Backup on Phone

adb backup -apk -noshared -all -f ./backup%DateString%.ab

adb kill-server
[Samsung Galaxy Nexus] Toys Samurai:
I am pretty sure this is not true, otherwise you would have pointed that out. But since the feature is called "Full Backup" and "Full Restore", shouldn't it restore the phone back to its original state, that is, the unrooted state?

Also, does anyone know if I can back up my old phone (an OG Droid) and restore it in a Galaxy Nexus? It doesn't sound possible, but it doesn't hurt to ask :-D
[Samsung Galaxy Nexus] copkay:
Clever. :) Thanks for that.

Nope. By "Full Backup", I simply mean it backs up all of your applications, rather than one at a time. All it does is make a local copy of the application data, the APKs if you specify it, and the local user settings, along with probably a few other things -- the specifics of which I'm not sure of -- and encrypts them in a single .ab backup file.

Since this is a 4.0 and up feature, you could not use it to backup your Droid.
[Samsung Galaxy Nexus] bennettvonbennett:
so - just to make it clear for anyone having the 0kb data problem, as specified earlier, you MUST set a password!

if you don't the process will appear to work but nothing will get backed up.

this was suggested earlier as a solution but i felt that it should be explicitly stated since there's now 100+ posts on here.

also - remember to unlock your screen! i sat there waiting and waiting to see the 'backup' screen on my phone, figuring that it would just appear. after about 5 minutes i grew curious and swiped the lock and - DOH! - there it was.

:-p

cheers
[Samsung Galaxy Nexus] PengLord:
The media backup can take awhile so I borrowed your batch file to give a menu. I have not tested the restore options and it loses the ability to do multiple backups.

echo off
SET Today=%Date: =0%
SET Year=%Today:~-4%
SET Month=%Today:~-10,2%
SET Day=%Today:~-7,2%
SET DateString=%Year%%Month%%Day%

:MENU
ECHO 1. Backup /data/media/
ECHO 2. Backup USER apps and data ONLY (excluding system apps)
ECHO 3. Backup USER apps and data AND shared data(excluding system apps)
ECHO 4. Backup ALL apps and data (including system apps and shared data)
ECHO 5. Restore /data/media
ECHO 6. Restore USER apps and data
ECHO 7. Restore ALL apps and data (including system apps)
ECHO 8. Quit
SET /p choice=Please choose a menu option:
IF '%choice%' == '1' GOTO BUMEDIA
IF '%choice%' == '2' GOTO BUUSERAPPS
IF '%choice%' == '3' GOTO BUUSERAPPSSHARED
IF '%choice%' == '4' GOTO BUALLAPPS
IF '%choice%' == '5' GOTO RESMEDIA
IF '%choice%' == '6' GOTO RESUSERAPPS
IF '%choice%' == '7' GOTO RESSYSAPPS
IF '%choice%' == '8' GOTO QUIT_MENU
ECHO Please choose an option between 1 and 8
GOTO MENU

:BUMEDIA
ECHO Backing up /data/media/
echo on
::adb pull /data/media/ ./%DateString%Media/
adb pull /data/media/ ./Media/
adb kill-server
ECHO OFF
CLS
GOTO MENU

:BUUSERAPPS
ECHO Unlock screen, set a password (required)
::adb backup -apk -shared -all -nosystem -f ./userbackup%DateString%.ab
adb backup -apk -shared -all -nosystem -f ./userbackup.ab
adb kill-server
CLS
REM Your device must return to the homescreen prior to disconnecting the USB cable
GOTO MENU

:BUUSERAPPSSHARED
ECHO Unlock screen, set a password (required)
::adb backup -apk -noshared -all -nosystem -f ./userbackup%DateString%.ab
adb backup -apk -noshared -all -nosystem -f ./userbackup.ab
adb kill-server
CLS
REM Your device must return to the homescreen prior to disconnecting the USB cable
GOTO MENU

:BUALLAPPS
ECHO Unlock screen, set a password (required)
::adb backup -apk -shared -all -system -f ./sysbackup%DateString%.ab
adb backup -apk -shared -all -f -system ./sysbackup.ab
adb kill-server
CLS
REM Your device must return to the homescreen prior to disconnecting the USB cable
GOTO MENU

:RESMEDIA
ECHO Restoring /data/media/
ECHO ON
adb push ./Media/ /data/media/
adb kill-server
ECHO OFF
CLS
GOTO MENU

:RESUSERAPPS
ECHO Unlock screen, enter the password
adb restore ./userbackup.ab
adb kill-server
CLS
REM Your device must return to the homescreen prior to disconnecting the USB cable
GOTO MENU

:RESSYSAPPS
ECHO Unlock screen, enter the password
adb restore ./sysbackup.ab
adb kill-server
CLS
REM Your device must return to the homescreen prior to disconnecting the USB cable
GOTO MENU

:QUIT_MENU
[Samsung Galaxy Nexus] DL16:
Thanks OP for posting this up.

I'm currently backing up on OSX right now. Not exactly sure where the file is going to wind up, but shouldn't be too hard to find.

Is this method a replacement for Titanium Backup moving forward?

Did you ever come to a conclusion on whether or not it's better to sync with google servers before starting the restore? Just curious about whether I should sign in before restoring.

Thanks!!!
[Samsung Galaxy Nexus] copkay:
Personally, I still use Titanium Backup for individual application backups and that sort of thing. It's more convenient for that. For doing a full system backup and restore, this is good if you're going between similar ROMs, but it's possible you could run into issues if you backup system apps between custom ROMs (speaking purely from conjecture here), but non-system apps should restore between ICS versions without problem. This really is just a convenient method for restoring from a factory reset (such as unlocking the bootloader, or restoring to a warranty replacement device).

As far as signing in before or after, I never tested it, but you won't have any serious problems either way. The annoyances I ran into were things like failed account verification requests from apps like Google Reader, trying to sign into an account that didn't yet exist. If you're not restoring system apps, then I'd definitely just sign in first, but keep in mind the Market is going to begin downloading ALL your apps automatically after you sign in (does ANYONE have a way to stop that from happening? Annoying as ****...), but your restore will replace them anyway.
[Samsung Galaxy Nexus] DL16:
Awesome. Thanks for the quick reply!
[Samsung Galaxy Nexus] afguy0127:
I wish I would've looked in this section of the forum and seen this before I rooted. I had found some method of this on another website somewhere, but I had some issues getting adb to pull the information, so I just bit the bullet and rooted. Oh well, c'est la vie. Great guide though, so it will at least get me to look next time, lol.
[Samsung Galaxy Nexus] tavik:
C:\android-sdk-windows\platform-tools>adb backup -all
adb: unable to open file ./backup.ab

I'm still getting the above error when trying to back data up off of my phone (regardless of the combination of parameters passed). The phone doesn't even bring up the backup dialog for me to start the backup. I don't think it's a communications issue, as I'm able to access the phone shell with "adb shell".

-Phone: CDMA/LTE Galaxy Nexus (stock 4.0.2, bootloader unlocked but not rooted)

-USB Debugging enabled

-running rev 10 of the Android SDK Platform tools

-Win7 x64 (w/SP1), with Samsung ADB driver

-tried with backup encryption turned on and off (made no difference)

-device encryption is not enabled
[Samsung Galaxy Nexus] kendogc:
Just want to say thanks! This worked like a treat for me!
[Samsung Galaxy Nexus] JRK-Scope:
Does anyone know if this method works across different ROMs?

I'm switching from stock ICL53F and I'm curious if it does.
[Samsung Galaxy Nexus] copkay:
Try

adb backup -all -f C:\backup.ab

Glad to hear it! :)

I would say it should work 100% of the time for third-party app restores, possibly less for system apps. If you're restoring only data (not the APKs) and the system apps have been modified in another ROM, the restored data could be incompatible with the modified version. On the other hand, if you restore APKs as well, if the ROM relies on the modified system APK, that could cause incompatibility. If you just use the -nosystem flag, I can't imagine you'd have any problems.
[Samsung Galaxy Nexus] tavik:
Still get the following:

C:\>adb backup -all -f c:\backup.ab
adb: unable to open file c:\backup.ab

My phone isn't even prompting me to start the backup.
[Samsung Galaxy Nexus] kekko986:
useful!!! thx!! best regards!
[Samsung Galaxy Nexus] copkay:
This may seem redundant, but try:

adb backup -f /backup/backup.ab -all

And then look for the file at C:\backup\backup.ab.
[Samsung Galaxy Nexus] tavik:
same result, no file created (nor was a directory). Didn't work after I created a "backup" directory either.
[Samsung Galaxy Nexus] NCguy:
I tried all this also and got exactly the same results. Just curious, have you installed the full adb? I only installed the utilities and I assumed that had something to do with it.
[Samsung Galaxy Nexus] tavik:
as far as I know I only installed the platform tools. The full SDK shouldn't be required to do a backup, right?
[Samsung Galaxy Nexus] clak84:
I can't get the backup to work either. I'm not getting an error, but I'm also not getting anything to come up on my phone. When I execute the backup it seems to run through it quickly, and then nothing. No file, nothing on my phone, nothing.
[Samsung Galaxy Nexus] copkay:
I would probably install the SDK just to be safe, but if you can call 'adb devices' and see your phone listed, that probably isn't the issue. Does it show up in the list when you do that?
[Samsung Galaxy Nexus] Znahoj:
Thanks!

Worked perfectly from a Mac. :)
[Samsung Galaxy Nexus] NCguy:
Yes it shows up on an adb devices.
[Samsung Galaxy Nexus] copkay:
What OS are you running? Is it possible your account is not an administrator? Even if you are, if you're on Windows 7, try opening the command prompt using Run As Administrator, and see if that changes anything.
[Samsung Galaxy Nexus] tavik:
My phone does show up in 'adb devices'. Running Win7 x64, and my account has admin rights. That said, running the console as Administrator did not help either.

Don't know if this helps to narrow it down, but the backup add doesn't even launch on my phone. Also, 'adb logcat' shows no activity when I run the backup command.
[Samsung Galaxy Nexus] NCguy:
All this confirmed on mine as well
[Samsung Galaxy Nexus] bfroehlich:
Make sure you have the latest version of platform-tools (which updates adb). it's available through the sdk manager.
[Samsung Galaxy Nexus] copkay:
Curious...you guys are doing this from stock, right? This isn't a custom ROM you're trying this with, is it?