Go Back   Android Forums > Android Phones > Samsung Galaxy Nexus

test: Reply
 
LinkBack Thread Tools
Old January 9th, 2012, 05:11 PM   #1 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Dec 2011
Posts: 53
 
Device(s): CDMA Galaxy Nexus
Carrier: Not Provided

Thanks: 0
Thanked 13 Times in 10 Posts
Default Backup and Restore without Root (Galaxy Nexus and Mac)

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:

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'



To explain the parameters:

Quote:
./adb backup -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:
./adb backup -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:
./adb backup -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:
./adb backup -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:
./adb backup -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:
./adb backup <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
or
./adb backup -apk -shared -all -----------and then just search for it in finder.
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:

Quote:
./adb restore /backup/mybackup.ab
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

Advertisements
Hipe0ples555 is offline  
Last edited by Hipe0ples555; February 3rd, 2012 at 06:55 PM.
Reply With Quote
The Following 2 Users Say Thank You to Hipe0ples555 For This Useful Post:
Riceboy22 (January 30th, 2012), s.m.knipe (February 16th, 2012)
sponsored links
Old January 15th, 2012, 10:55 AM   #2 (permalink)
Junior Member
 
Join Date: Sep 2010
Posts: 29
 
Device(s):
Carrier: Not Provided

Thanks: 2
Thanked 0 Times in 0 Posts
Default

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

assistance?
bobthebob is offline  
Last edited by bobthebob; January 15th, 2012 at 11:25 AM.
Reply With Quote
Old January 15th, 2012, 11:00 AM   #3 (permalink)
Senior Member
 
Join Date: Nov 2009
Location: The South
Posts: 2,418
 
Device(s): S4, Note 2, +many others
Carrier: Verizon

Thanks: 166
Thanked 303 Times in 245 Posts
Send a message via AIM to syntrix
Default

I gave some sample commands here... however the /sdcard/ pull is only pulling the music folder, ugh.
syntrix is offline  
Reply With Quote
Old January 15th, 2012, 03:21 PM   #4 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Dec 2011
Posts: 53
 
Device(s): CDMA Galaxy Nexus
Carrier: Not Provided

Thanks: 0
Thanked 13 Times in 10 Posts
Default

Quote:
Originally Posted by bobthebob View Post
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...

assistance?
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.
Hipe0ples555 is offline  
Reply With Quote
Old January 30th, 2012, 06:00 PM   #5 (permalink)
New Member
 
Join Date: Oct 2008
Posts: 3
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

you need to get the newest USB drivers from Samsung. Also I don't think this will backup photos/videos or Music
chooven is offline  
Reply With Quote
Old January 30th, 2012, 07:29 PM   #6 (permalink)
Junior Member
 
Join Date: Nov 2009
Posts: 67
 
Device(s):
Carrier: Not Provided

Thanks: 4
Thanked 16 Times in 12 Posts
Default

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:

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

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"


...HALP?

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
xavious85 is offline  
Last edited by xavious85; January 30th, 2012 at 07:44 PM.
Reply With Quote
Old January 30th, 2012, 07:51 PM   #7 (permalink)
Senior Member
 
Join Date: Nov 2009
Location: The South
Posts: 2,418
 
Device(s): S4, Note 2, +many others
Carrier: Verizon

Thanks: 166
Thanked 303 Times in 245 Posts
Send a message via AIM to syntrix
Default

Quote:
Originally Posted by xavious85 View Post
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:

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

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"


...HALP?

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
./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?
syntrix is offline  
Reply With Quote
The Following User Says Thank You to syntrix For This Useful Post:
xavious85 (January 30th, 2012)
Old January 30th, 2012, 07:57 PM   #8 (permalink)
Junior Member
 
Join Date: Nov 2009
Posts: 67
 
Device(s):
Carrier: Not Provided

Thanks: 4
Thanked 16 Times in 12 Posts
Default

Quote:
Originally Posted by syntrix View Post
./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?
How embarrassing, I forgot to enable USB debugging. That did the trick, thanks!
xavious85 is offline  
Reply With Quote
Old January 30th, 2012, 08:27 PM   #9 (permalink)
Senior Member
 
Join Date: Nov 2009
Location: The South
Posts: 2,418
 
Device(s): S4, Note 2, +many others
Carrier: Verizon

Thanks: 166
Thanked 303 Times in 245 Posts
Send a message via AIM to syntrix
Default

Quote:
Originally Posted by xavious85 View Post
How embarrassing, I forgot to enable USB debugging. That did the trick, thanks!
rawr!

I've done that many o' times!
syntrix is offline  
Reply With Quote
Old January 30th, 2012, 09:36 PM   #10 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Dec 2011
Posts: 53
 
Device(s): CDMA Galaxy Nexus
Carrier: Not Provided

Thanks: 0
Thanked 13 Times in 10 Posts
Default

So is everyone ok? All problems are solved?
Hipe0ples555 is offline  
Reply With Quote
sponsored links
Old February 4th, 2012, 11:26 PM   #11 (permalink)
Junior Member
 
RandyRKelly's Avatar
 
Join Date: Dec 2009
Location: Dalls,TX
Posts: 21
 
Device(s): Eris,Storm 2
Carrier: Not Provided

Thanks: 3
Thanked 0 Times in 0 Posts
Send a message via AIM to RandyRKelly Send a message via Yahoo to RandyRKelly
Default

one quick question, does this backup the Internal memory also? AKA SD
RandyRKelly is offline  
Reply With Quote
Old February 5th, 2012, 11:50 AM   #12 (permalink)
Senior Member
 
Join Date: Nov 2009
Location: The South
Posts: 2,418
 
Device(s): S4, Note 2, +many others
Carrier: Verizon

Thanks: 166
Thanked 303 Times in 245 Posts
Send a message via AIM to syntrix
Default

Quote:
Originally Posted by RandyRKelly View Post
one quick question, does this backup the Internal memory also? AKA SD
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.
syntrix is offline  
Reply With Quote
Old February 5th, 2012, 12:19 PM   #13 (permalink)
Junior Member
 
RandyRKelly's Avatar
 
Join Date: Dec 2009
Location: Dalls,TX
Posts: 21
 
Device(s): Eris,Storm 2
Carrier: Not Provided

Thanks: 3
Thanked 0 Times in 0 Posts
Send a message via AIM to RandyRKelly Send a message via Yahoo to RandyRKelly
Default

Quote:
Originally Posted by syntrix View Post
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.
will gie it a try right now
RandyRKelly is offline  
Reply With Quote
Old February 5th, 2012, 12:30 PM   #14 (permalink)
Junior Member
 
RandyRKelly's Avatar
 
Join Date: Dec 2009
Location: Dalls,TX
Posts: 21
 
Device(s): Eris,Storm 2
Carrier: Not Provided

Thanks: 3
Thanked 0 Times in 0 Posts
Send a message via AIM to RandyRKelly Send a message via Yahoo to RandyRKelly
Default

Quote:
Originally Posted by RandyRKelly View Post
will gie it a try right now
Quote:
Originally Posted by syntrix View Post
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.
worked, thanks


667 files pulled. 0 files skipped.
1059 KB/s (87865555 bytes in 80.987s)
RandyRKelly is offline  
Reply With Quote
Old February 5th, 2012, 01:36 PM   #15 (permalink)
Senior Member
 
Join Date: Nov 2009
Location: The South
Posts: 2,418
 
Device(s): S4, Note 2, +many others
Carrier: Verizon

Thanks: 166
Thanked 303 Times in 245 Posts
Send a message via AIM to syntrix
Default

Quote:
Originally Posted by RandyRKelly View Post
worked, thanks


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

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!
syntrix is offline  
Reply With Quote
Old February 5th, 2012, 01:52 PM   #16 (permalink)
Junior Member
 
RandyRKelly's Avatar
 
Join Date: Dec 2009
Location: Dalls,TX
Posts: 21
 
Device(s): Eris,Storm 2
Carrier: Not Provided

Thanks: 3
Thanked 0 Times in 0 Posts
Send a message via AIM to RandyRKelly Send a message via Yahoo to RandyRKelly
Default

Quote:
Originally Posted by syntrix View Post
Outstanding!

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!
yeah and i was having issues to. but im good now
RandyRKelly is offline  
Reply With Quote
Old February 16th, 2012, 04:43 AM   #17 (permalink)
New Member
 
Join Date: Jan 2011
Posts: 10
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

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 perfectly..it 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 actions...do you know why?

thanks
regards
zero0n3 is offline  
Reply With Quote
Old February 16th, 2012, 07:43 AM   #18 (permalink)
Senior Member
 
Join Date: Nov 2009
Location: The South
Posts: 2,418
 
Device(s): S4, Note 2, +many others
Carrier: Verizon

Thanks: 166
Thanked 303 Times in 245 Posts
Send a message via AIM to syntrix
Default

Quote:
Originally Posted by zero0n3 View Post
hello guys!
thanks for wonderful guide

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 actions...do you know why?

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


also make sure your device is showing:

adb devices
syntrix is offline  
Reply With Quote
Old February 16th, 2012, 07:48 AM   #19 (permalink)
New Member
 
Join Date: Jan 2011
Posts: 10
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by syntrix View Post
adb backup -f D:\android\nexus\backup\nexus.ab -apk -shared -all


also make sure your device is showing:

adb devices

thanks, in few hours i will be at home and i try
zero0n3 is offline  
Reply With Quote
Old February 16th, 2012, 01:09 PM   #20 (permalink)
New Member
 
Join Date: Jan 2011
Posts: 10
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

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?
thanks
regards

Simon
zero0n3 is offline  
Reply With Quote
sponsored links
Old February 16th, 2012, 01:56 PM   #21 (permalink)
Senior Member
 
Join Date: Nov 2009
Location: The South
Posts: 2,418
 
Device(s): S4, Note 2, +many others
Carrier: Verizon

Thanks: 166
Thanked 303 Times in 245 Posts
Send a message via AIM to syntrix
Default

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:

C:\android\android-sdk-windows\platform-tools
syntrix is offline  
Reply With Quote
Old February 16th, 2012, 02:37 PM   #22 (permalink)
New Member
 
Join Date: Jan 2011
Posts: 10
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
zero0n3 is offline  
Reply With Quote
Old March 8th, 2012, 10:21 AM   #23 (permalink)
New Member
 
Join Date: Jan 2011
Posts: 10
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

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?

thanks
regards
zero0n3 is offline  
Reply With Quote
Old March 21st, 2012, 05:27 PM   #24 (permalink)
New Member
 
Join Date: Jan 2012
Posts: 14
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

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?
thetrystero is offline  
Reply With Quote
Old March 22nd, 2012, 05:57 PM   #25 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Dec 2011
Posts: 53
 
Device(s): CDMA Galaxy Nexus
Carrier: Not Provided

Thanks: 0
Thanked 13 Times in 10 Posts
Default

Quote:
Originally Posted by thetrystero View Post
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?
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!!
Hipe0ples555 is offline  
Reply With Quote
Old March 22nd, 2012, 06:00 PM   #26 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Dec 2011
Posts: 53
 
Device(s): CDMA Galaxy Nexus
Carrier: Not Provided

Thanks: 0
Thanked 13 Times in 10 Posts
Default

Quote:
Originally Posted by zero0n3 View Post
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?

thanks
regards
I cannot answer this because I did not "write" the commands, I only transformed them into ones that work on macs. However, I would suggest heading here [GUIDE] Full Phone Backup without Unlock or Root - xda-developers and asking the man who came up with the original commands, sorry.
Hipe0ples555 is offline  
Reply With Quote
Reply

Galaxy Nexus
Current Rating:
Rate this Phone:

The Galaxy Nexus is the third official phone contracted by Google and the first phone to come with Android 4.0 Ice Cream Sandwich. Specs include a 1.2GHz dual-core processor, 1GB of RAM, 16/32GB of internal storage, a 4.65 inch 720p HD Super AMOLED... Read More



Go Back   Android Forums > Android Phones > Samsung Galaxy Nexus

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 06:36 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.