Backup and Restore without Root (Galaxy Nexus and Mac)Support

Last Updated:

  1. Hipe0ples555

    Hipe0ples555 Well-Known Member

    UPDATED 2/3/12

    Thanks to @copkay for writing this! [GUIDE] Full Phone Backup without Unlock or Root - xda-developers (windows version)

    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.

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

    2. In Terminal, type "cd " with the space and then drag your "platform-tools" folder in the android sdk where the space is, it should look like this "cd /where ever you put the folder/name of you computer/android-sdk-mac-osx/platform-tools". Drag and drop will do this for you, then hit enter.


    3. In the same terminal window, type "./adb" and hit enter. A lot of stuff with come up that you really dont need to worry about.


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


    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'


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


    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 should get a toast on-screen saying 'Backup Complete', or if you miss that, you'll know once your command line has returned.

    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 '/backup/mybackup.ab' with the location of your backup file.

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


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

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

    - Sean

    s.m.knipe and Riceboy22 like this.
  2. bobthebob

    bobthebob Active Member

    hey thanks a lot for this buddy - unfortunately I cannot get my Gnex to show up in the list of devices. I use adb often enough to have a PATH variable for it in my bash_profile so - while I'm no UNIX ninja, I do know more or less what I'm doing.

    anyway - I can't seem to get the phone recognized by adb... using latest SDK Tools version (16 I believe?).

    what am I missing?


    update - hold on... I just realized my install of the latest SDK tools wasn't quite finished - it got hung up waiting for a password for some stupid Motorola plug in - I'm finishing up the d/l now and hopefully will have the up-to-date SDK tools after, which I hope will fix the problem.


    2nd UPDATE - not working. all SDK's updated and current. still nothing shows up under list of devices...

  3. syntrix

    syntrix Well-Known Member

    I gave some sample commands here... however the /sdcard/ pull is only pulling the music folder, ugh.
  4. Hipe0ples555

    Hipe0ples555 Well-Known Member

    Did you do the first "cd " and drag the platform tools command, and if you did, next, id no error occur, type"./adb" and hit enter! And make sure usb debugging is on but it probably is.
  5. chooven

    chooven New Member

    you need to get the newest USB drivers from Samsung. Also I don't think this will backup photos/videos or Music
  6. xavious85

    xavious85 Well-Known Member

    So I was able to restore, unlock the bootloader and root successfully following this and various other guide. I'm now in the process of attempting to restore my back up, which is located in:


    When I attempt to type the following in the terminal:

    ./adb restore backup.ab

    I get a message that says "unable to connect for backup"

    If I attempt to type in the following as stated in the guide:

    ./adb restore /backup/backup.ab

    I get a message that says "unable to open file /backup.ab"


    EDIT: I just ran ./adb devices in terminal and nothing was listed which leads me to believe this is the source of my problem. How can I address this? I noticed that earlier when I had the phone plugged in through a USB hub, the device was not listed. I then plugged the device directly into my laptop and it was listed when I ran ./adb devices
  7. syntrix

    syntrix Well-Known Member

    ./adb restore /android-sdks/platform-tools/backup.ab

    OR adb devices

    and do

    ./adb -s ######### restore..... etc.

    where ############### is your device id.

    edit: saw your edit... you need to be able to connect first... usb debugging, etc?
    xavious85 likes this.
  8. xavious85

    xavious85 Well-Known Member

    How embarrassing, I forgot to enable USB debugging. That did the trick, thanks!
  9. syntrix

    syntrix Well-Known Member

    rawr! :D

    I've done that many o' times!
  10. Hipe0ples555

    Hipe0ples555 Well-Known Member

    So is everyone ok? All problems are solved?
  11. RandyRKelly

    RandyRKelly Member

    one quick question, does this backup the Internal memory also? AKA SD
  12. syntrix

    syntrix Well-Known Member

    No, even though it says "all" it really doesn't work... use:

    adb -s 00000000000000 pull /sdcard/ D:\android\nexus\backup

    the `-s [device id#]` part is optional. Also read the last lines of the backup when done, if it doesn't mention the number of files, it didn't complete successfully.
  13. RandyRKelly

    RandyRKelly Member

    will gie it a try right now
  14. RandyRKelly

    RandyRKelly Member

    worked, thanks

    667 files pulled. 0 files skipped.
    1059 KB/s (87865555 bytes in 80.987s)
  15. syntrix

    syntrix Well-Known Member


    I actually stumbled upon that method after trying many ways of "one click" sd card backup. I could never just select everything and drag to a windows folder, always got errors and the copy aborted. Sync tools used drive letters for every one that I could find.

    Now I have a script that I run to do the ab backup and my sd in one shot. Works like a charm!
  16. RandyRKelly

    RandyRKelly Member

    yeah and i was having issues to. but im good now
  17. zero0n3

    zero0n3 Member

    hello guys!
    thanks for wonderful guide

    i tried with my rooted nexus (i think it works also with a rooted one)
    if i use ./adb backup -all it works ask me password and go on...
    if i use ./adb backup -apk nothing happens...Nexus doesn't ask me password
    adb only create a zerobyte backup.ab file but no more you know why?

  18. syntrix

    syntrix Well-Known Member

    adb backup -f D:\android\nexus\backup\nexus.ab -apk -shared -all

    also make sure your device is showing:

    adb devices
  19. zero0n3

    zero0n3 Member

    thanks, in few hours i will be at home and i try
  20. zero0n3

    zero0n3 Member

    i tried
    but it backup only shared and system data

    i tried with -apk -shared -all and it create a file of 229MB
    i tried with -share -all and it create a file like the first (same checksum)
    i tried with only -apk and it create a zerobyte file....

    could it be becouse i've a rooted device?

  21. syntrix

    syntrix Well-Known Member

    can't remember what worked and didn't at the time, but perhaps update your sdk, and make sure you are using the new version of adb?

    For example, on this computer I have it located here:

  22. zero0n3

    zero0n3 Member

    i tried to update using android update sdk --no-ui from command line in OSX (not win)
    updated android sdk
    nothing changed....same result..
    well if no one got this problems i will try to unroot device and trying with a "clear" device

    thanks anyway :D
  23. zero0n3

    zero0n3 Member

    hi guys

    first question : after a full backup of shared, all and apk is it possible to restore only a particular apk?

    second question : i've restored my entire backup
    all done...but:
    my personal directories or third-part program dirs wasn't backupped, like /sdcard/Camscanner or /sdcard/media
    is it possible to bakcup all my personal dirs and then restore also them with adb bakcup/restore commands?

  24. thetrystero

    thetrystero Member

    i've tried to backup several times now, but each time, the backup stops at random places. the first time at about 300mb, then 400mb, and then 600mb. i did the -apk backup and i know that i should be getting several GB worth. any ideas?
  25. Hipe0ples555

    Hipe0ples555 Well-Known Member

    This happened to me too, accept I don't think with the apk but it should be the same. All I did was unplugged the phone, quit terminal, made sure the Android SDK was all updated and re-tried! Hope it works!!

Share This Page