Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[GUIDE] Full Phone Backup without Unlock or Root

OP copkay

View First Unread
31st December 2011, 08:02 AM   |  #1  
OP Senior Member
Thanks Meter: 457
 
354 posts
Join Date:Joined: Jul 2010
Donate to Me
More
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:

Quote:

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

The most basic command you can use* is simply:

Quote:

adb backup -all

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:

Quote:

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

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

To explain the parameters:

Quote:

-f <file>

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.

Quote:

-apk|-noapk

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.

Quote:

-shared|-noshared

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.

Quote:

-all

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.

Quote:

-system|-nosystem

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.

Quote:

<packages...>

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:

Quote:

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

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

Quote:

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:



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
Last edited by copkay; 18th June 2012 at 05:31 AM. Reason: clarified some things
The Following 335 Users Say Thank You to copkay For This Useful Post: [ View ]
31st December 2011, 08:24 AM   |  #2  
Senior Member
Flag Kuala Lumpur
Thanks Meter: 13
 
283 posts
Join Date:Joined: Feb 2010
More
In earlier build of ics there's an option to do such backup under back up and restore settings.

However it's not there in final ics.

I've done it once when I flashed one of those early build of ics on nexus s.
31st December 2011, 08:26 AM   |  #3  
OP Senior Member
Thanks Meter: 457
 
354 posts
Join Date:Joined: Jul 2010
Donate to Me
More
Quote:
Originally Posted by faizalmzain

In earlier build of ics there's an option to do such backup under back up and restore settings.

However it's not there in final ics.

I've done it once when I flashed one of those early build of ics on nexus s.

Interesting. They must have deemed it not quite ready for primetime yet. Seems like it should show up in a future version sometime in the not-too-distant future, then. Until then, this seems to work pretty well.
The Following User Says Thank You to copkay For This Useful Post: [ View ]
31st December 2011, 07:48 PM   |  #4  
Senior Member
Flag Los Angeles, CA
Thanks Meter: 396
 
5,578 posts
Join Date:Joined: Apr 2010
I just finally rooted. The longer you wait the more painful it will be to start over, so just get it over with. If the adb method qorkks then great. I've flashed and rooted so many phones that its just better to get it over with as pukemon will tell you.
31st December 2011, 09:32 PM   |  #5  
OP Senior Member
Thanks Meter: 457
 
354 posts
Join Date:Joined: Jul 2010
Donate to Me
More
Quote:
Originally Posted by RogerPodacter

I just finally rooted. The longer you wait the more painful it will be to start over, so just get it over with. If the adb method qorkks then great. I've flashed and rooted so many phones that its just better to get it over with as pukemon will tell you.

While that's true, if you're already past the point of painful return, why start over when this backup method is available? It's not a question of if it works (it does work).
31st December 2011, 09:39 PM   |  #6  
Member
Thanks Meter: 4
 
32 posts
Join Date:Joined: Dec 2011
More
my first post. i have successfully taken a full backup using your guide and it worked great. thanks! my question is can i now unlock the boot loader and root then restore my backup and i will have all my settings and apps along with still having the unlocked boot loader and root?
31st December 2011, 11:17 PM   |  #7  
OP Senior Member
Thanks Meter: 457
 
354 posts
Join Date:Joined: Jul 2010
Donate to Me
More
Quote:
Originally Posted by sahakiap

my first post. i have successfully taken a full backup using your guide and it worked great. thanks! my question is can i now unlock the boot loader and root then restore my backup and i will have all my settings and apps along with still having the unlocked boot loader and root?

Yes, as shown in the guide, just use the 'adb restore' command after unlocking the bootloader. You may wish to backup your Internal Storage manually, just to be safe, and backup your SMS with a third party app, if you care to keep them. Obtaining root isn't covered in this guide, but yeah, you can root it once you've unlocked the bootloader.
3rd January 2012, 01:03 AM   |  #8  
Junior Member
Thanks Meter: 2
 
10 posts
Join Date:Joined: Jun 2010
I have been trying to do this, but when after i "backup" the backup file shows no size. Am I missing a step?
3rd January 2012, 02:54 AM   |  #9  
OP Senior Member
Thanks Meter: 457
 
354 posts
Join Date:Joined: Jul 2010
Donate to Me
More
Quote:
Originally Posted by ktulu029

I have been trying to do this, but when after i "backup" the backup file shows no size. Am I missing a step?

Interesting. Could you post the exact command that you used, and also what OS you're running?
3rd January 2012, 03:15 AM   |  #10  
Junior Member
Thanks Meter: 2
 
10 posts
Join Date:Joined: Jun 2010
Quote:
Originally Posted by copkay

Interesting. Could you post the exact command that you used, and also what OS you're running?

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.
Last edited by ktulu029; 3rd January 2012 at 03:30 AM.

Post Reply Subscribe to Thread

Tags
adb, android, backup, ice-cream-sandwich, restore
Previous Thread Next Thread