[GUIDE] Full Phone Backup without Unlock or Root

Search This thread

DeputyStankus

Member
Nov 9, 2008
22
2
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?

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!
 

0ldsoul

Member
Mar 26, 2023
18
5
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!
If you're staying stock. LG V20 has LG backup app. Its's like TB without root. You can restore data using that app.
 

DeputyStankus

Member
Nov 9, 2008
22
2
If you're staying stock. LG V20 has LG backup app. Its's like TB without root. You can restore data using that app.
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?
 
Last edited:

0ldsoul

Member
Mar 26, 2023
18
5
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?
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.
 

vindicatorr

Member
Jan 20, 2013
49
8
You're missing a command, it's
Code:
 prompt$ adb shell bu backup -apk -blahblah
See, you're missing the 'bu', there's bu backup and bu restore...
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
Code:
$ 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.
 

AntonyMan

Member
Sep 25, 2017
31
3
Athens
Xiaomi Mi A2 Lite
Code:
adb backup -apk -shared -all -f /c/backup.ab

I am running win 7 x64, and my phone is running 4.0.2 if that is useful information.

It runs everything on the phone like prompted, just doesn't save any data.
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...>]
 
Last edited:

m0han

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

..adb restore C:\Users\amirk\Documents\backup.ab
.... The correct is: adb backup -f "c:/backup.ab" -apk -shared -all...
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.
 

Attachments

  • Screenshot_20230821_151952.jpg
    Screenshot_20230821_151952.jpg
    82.4 KB · Views: 70

tor111

New member
Mar 19, 2023
2
0
Like a lot of you, I have been putting off unlocking the bootloader on my Nexus because I didn't want to have to go through the hassle of backing up everything manually and restoring individual application data; logging back into apps; saving settings; etc. I found an undocumented (at least as far as my googling was able to find) feature in the latest version of the ADB platform tools (for Android 4.0+) that allows you to create a full system backup, including app apks, their respective data, as well as the internal storage.

Keep in mind this is experimental and not exactly publicized as a feature of ICS, so don't count on this as your only method of backup!

This guide assumes you have already installed the Android SDK, and updated the Android SDK Platform Tools to the latest version (currently Rev 10) using the SDK Manager.

1. Connect your device via USB, and open a command prompt.

2. Optionally, type the command 'adb devices' to ensure that your device is properly recognized. If you're comfortable with ADB already, just skip this.

There is a command, 'adb backup' (to be detailed shortly), that will now allow you to create a full system backup.

The command parameters format is:



The most basic command you can use* is simply:



This will use the defaults to backup only app and device data (not the APKs themselves) to the current directory as 'backup.ab'

* This may not work for every setup. If you get an error such as "adb: cannot open file ./backup.ab", use:



Or substitute the path of your choice in place of C:\.

To explain the parameters:



Use this to choose where the backup file will be stored, e.g. '-f /backup/mybackup.ab', which will save it at the root of your drive (C:\ for Windows, etc.) in a folder called backup, as a file named 'mybackup.ab'. I recommend using this flag to set a location manually, as with my first backup test, it said that it completed successfully, but I was unable to locate the backup file. I have no idea where it was saved, but it wasn't where it should have been located.



This flags whether or not the APKs should be included in the backup or just the apps' respective data. I personally use -apk just in case the app isn't available in the Market, so that I don't have to go hunt it down again. The default is -noapk.



This flag is used to "enable/disable backup of the device's shared storage / SD card contents; the default is noshared.", which for the Nexus I would certainly flag to -shared, but from my test, it did not restore all of the contents of my internal storage, so I recommend backing up music, pictures, video, and other internal storage items manually, just to be on the safe side. The default is -noshared.



This flag is just an easy way to say to backup ALL apps. The packages flag (further on) can be used to choose individual packages, but unless you're just wanting to backup a specific application, use -all for a full system backup.



This flag sets whether or not the -all flag also includes system applications or not. I used -system, but this is probably unnecessary, and I would almost guess that it is safer to use -nosystem, but use your own judgment on this. The default is -system.



Here you can list the package names (e.g. com.google.android.apps.plus) specifically that you would like to backup. Use this only if you're looking to backup a specific application.

3. Once you've made your decision on how to perform the backup, simply type the command as you would like it; in my case, this is the command that I used:



4. You will see a screen like the following:

OGmMa.png


5. Enter a password (if desired) for encryption of the backup file. RETAIN THIS PASSWORD FOR RESTORING LATER.

6. This process will take several minutes to complete, depending on the settings you've chosen, but when completed, you will get a toast on-screen saying 'Backup Complete', or if you miss that, you'll know once your phone returns to the home screen.

7. Now go unlock your bootloader (not going to go into the process for this guide, but you probably know how already, and if not, there are several guides a search away).

8. Once you're booted back into Android, you can choose to add your account now, or skip that for later. I skipped it for later, but I think it might make the process more smooth to sign in before the restore. YMMV.

9. To restore, with your device connected open your command prompt again, and type:



replacing 'C:\backup20111230.ab' with the location of your backup file.

10. You will see a screen like the one below:

MT9Sl.png


11. Simply type in your current encryption password (if you've set one), and the password with which the backup was encrypted (if you chose to set a password), and the restore will begin. It again will take several minutes depending on the size of the backup and the options chosen.

12. You're back to normal, short of possibly some widgets on the home screen. My wallpaper was even restored, my app folders remained just as I had them before, my alarms remained, and for most applications, I didn't even have to log back in; it kept everything.

________________________

NOTE: I did have an issue with not all files being restored to the Internal Storage; in particular, the Gallery still displayed all the folders and files that it had cached (which it expected to be there) as only gray boxes, and would not display the images, nor would it rescan the media. I simply copied the files back to the Internal Storage directory manually, and all was well again. Again, YMMV.

NOTE 12/31: Also to note, this will not back up SMS messages, so if you're concerned about those, you may want to look into an alternative application to back up SMS.

NOTE 06/12: There seems to be a bug in which backup and restore operations will fail unless a desktop backup password is set under Developer Options. It will not work with a blank password.

Hope this is able to help! If so, give me a thanks :))) and let me know how your experience goes.

- Kevin
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.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 488
    Like a lot of you, I have been putting off unlocking the bootloader on my Nexus because I didn't want to have to go through the hassle of backing up everything manually and restoring individual application data; logging back into apps; saving settings; etc. I found an undocumented (at least as far as my googling was able to find) feature in the latest version of the ADB platform tools (for Android 4.0+) that allows you to create a full system backup, including app apks, their respective data, as well as the internal storage.

    Keep in mind this is experimental and not exactly publicized as a feature of ICS, so don't count on this as your only method of backup!

    This guide assumes you have already installed the Android SDK, and updated the Android SDK Platform Tools to the latest version (currently Rev 10) using the SDK Manager.

    1. Connect your device via USB, and open a command prompt.

    2. Optionally, type the command 'adb devices' to ensure that your device is properly recognized. If you're comfortable with ADB already, just skip this.

    There is a command, 'adb backup' (to be detailed shortly), that will now allow you to create a full system backup.

    The command parameters format is:

    adb backup [-f <file>] [-apk|-noapk] [-shared|-noshared] [-all] [-system|nosystem] [<packages...>]

    The most basic command you can use* is simply:


    This will use the defaults to backup only app and device data (not the APKs themselves) to the current directory as 'backup.ab'

    * This may not work for every setup. If you get an error such as "adb: cannot open file ./backup.ab", use:

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

    Or substitute the path of your choice in place of C:\.

    To explain the parameters:


    Use this to choose where the backup file will be stored, e.g. '-f /backup/mybackup.ab', which will save it at the root of your drive (C:\ for Windows, etc.) in a folder called backup, as a file named 'mybackup.ab'. I recommend using this flag to set a location manually, as with my first backup test, it said that it completed successfully, but I was unable to locate the backup file. I have no idea where it was saved, but it wasn't where it should have been located.


    This flags whether or not the APKs should be included in the backup or just the apps' respective data. I personally use -apk just in case the app isn't available in the Market, so that I don't have to go hunt it down again. The default is -noapk.


    This flag is used to "enable/disable backup of the device's shared storage / SD card contents; the default is noshared.", which for the Nexus I would certainly flag to -shared, but from my test, it did not restore all of the contents of my internal storage, so I recommend backing up music, pictures, video, and other internal storage items manually, just to be on the safe side. The default is -noshared.


    This flag is just an easy way to say to backup ALL apps. The packages flag (further on) can be used to choose individual packages, but unless you're just wanting to backup a specific application, use -all for a full system backup.


    This flag sets whether or not the -all flag also includes system applications or not. I used -system, but this is probably unnecessary, and I would almost guess that it is safer to use -nosystem, but use your own judgment on this. The default is -system.


    Here you can list the package names (e.g. com.google.android.apps.plus) specifically that you would like to backup. Use this only if you're looking to backup a specific application.

    3. Once you've made your decision on how to perform the backup, simply type the command as you would like it; in my case, this is the command that I used:

    adb backup -apk -shared -all -f C:\backup20111230.ab

    4. You will see a screen like the following:

    OGmMa.png


    5. Enter a password (if desired) for encryption of the backup file. RETAIN THIS PASSWORD FOR RESTORING LATER.

    6. This process will take several minutes to complete, depending on the settings you've chosen, but when completed, you will get a toast on-screen saying 'Backup Complete', or if you miss that, you'll know once your phone returns to the home screen.

    7. Now go unlock your bootloader (not going to go into the process for this guide, but you probably know how already, and if not, there are several guides a search away).

    8. Once you're booted back into Android, you can choose to add your account now, or skip that for later. I skipped it for later, but I think it might make the process more smooth to sign in before the restore. YMMV.

    9. To restore, with your device connected open your command prompt again, and type:

    adb restore C:\backup20111230.ab

    replacing 'C:\backup20111230.ab' with the location of your backup file.

    10. You will see a screen like the one below:

    MT9Sl.png


    11. Simply type in your current encryption password (if you've set one), and the password with which the backup was encrypted (if you chose to set a password), and the restore will begin. It again will take several minutes depending on the size of the backup and the options chosen.

    12. You're back to normal, short of possibly some widgets on the home screen. My wallpaper was even restored, my app folders remained just as I had them before, my alarms remained, and for most applications, I didn't even have to log back in; it kept everything.

    ________________________

    NOTE: I did have an issue with not all files being restored to the Internal Storage; in particular, the Gallery still displayed all the folders and files that it had cached (which it expected to be there) as only gray boxes, and would not display the images, nor would it rescan the media. I simply copied the files back to the Internal Storage directory manually, and all was well again. Again, YMMV.

    NOTE 12/31: Also to note, this will not back up SMS messages, so if you're concerned about those, you may want to look into an alternative application to back up SMS.

    NOTE 06/12: There seems to be a bug in which backup and restore operations will fail unless a desktop backup password is set under Developer Options. It will not work with a blank password.

    Hope this is able to help! If so, give me a thanks :))) and let me know how your experience goes.

    - Kevin
    5
    I've always been able to perform an adb backup using the command adb backup -apk -shared -all -f D:\Android\Nexus5\YYYYMMDD.ab

    But since upgrading the SDK platform-tools using installer_r24.4.1-windows.exe now when I use the same command I get the error message
    adb: unable to open file D:\Android\Nexus5\YYYYMMDD.ab
    and in the D:\Android\Nexus5 folder is an empty folder named YYYYMMDD.ab

    To get the ADB backup to work I have to open the CMD window in the D:\Android\Nexus5 folder and then modify the backup command to
    adb backup -apk -shared -all -f YYYYMMDD.ab
    4
    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
    3
    I created a simple DOS batch script to pull the media contents and then do a adb backup.

    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.

    Code:
    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
    3
    Is there any way to verify the integrity of the backup file?

    Yes, in a way : http://xdaforums.com/showthread.php?t=1730309

    With this you can "unpack" the .ab file and then be sure it can be read without error.
    Hope this helped you