I'm having some problems using "adb backup" with my stock & locked Nexus 6P.
When I run "adb backup -apk -all -obb -shared -f foo.ab" the device asks me about an backup ecryption key and my confirmation. When I do so the buttons turn grey and a confirmation toast pops up.
However, the created "foo.ab" file stays basically empty at 517 bytes.
Any idea?
EDIT: Seems like adb didn't like the sshfs folder. Works fine locally. Nevermind then!
same problem
Related
So I just successfully figured out how to backup and restore all Locale (THE PROGRAM) settings/preferences/profiles/etc.
TO BACKUP:
adb pull /data/data/edu.mit.locale /locale
TO RESTORE (after wipe):
adb push /locale /data/data/edu.mit.locale
Please don't ask how to setup ADB...SEARCH if you have problems such as that.
I take no responsibility if this messes up your phone (but I have no idea how it would).
Sweet! Will the same technique work for Open Home (or whatever)?
probably! i'm not really good with this stuff so i was really proud when this worked. but yeah you could just do
adb shell
ls /data/data
find the open home (or another programs') folder (probably looks like com.something.something)
that's to get the PATH to that folder. then do:
exit
adb pull /data/data/com.something.something /TheFolderOnYourComputer
and finally:
adb push /TheFolderOnYourComputer /data/data/com.something.something
cboy007 said:
probably! i'm not really good with this stuff so i was really proud when this worked. but yeah you could just do
adb shell
ls /data/data
find the open home (or another programs') folder (probably looks like com.something.something)
that's to get the PATH to that folder. then do:
exit
adb pull /data/data/com.something.something /TheFolderOnYourComputer
and finally:
adb push /TheFolderOnYourComputer /data/data/com.something.something
Click to expand...
Click to collapse
Openhome2 = com.betterandroid.openhome2
Not that much of a discovery but still a valid one.
You just copy the contents of /data/data and replace/add it after you update/wipe your phone
cboy007 said:
So I just successfully figured out how to backup and restore all Locale (THE PROGRAM) settings/preferences/profiles/etc.
TO BACKUP:
adb pull /data/data/edu.mit.locale /locale
TO RESTORE (after wipe):
adb push /locale /data/data/edu.mit.locale
Please don't ask how to setup ADB...SEARCH if you have problems such as that.
I take no responsibility if this messes up your phone (but I have no idea how it would).
Click to expand...
Click to collapse
Thank you so much for that discovery!! Might not seem so impressive to one person, but this will be a hand saver for me. One less thing to set up after each wipe. Thank you so much again!!
Alright, I faced this problem a few days backed, and when I did my research I found that a lot of people face this problem, or once in a while at least:
When you try to do a nandroid restore you see this:
Error: run ' nandroid- mobile. sh restore ' via console!
So you try to do it via adb (aka console) and you get this:
Error: unable to mount /sdcard, aborting
Frustrating right! You have messed up your phone while tweaking and thought you had the upper hand because you did a back-up.. but now you are dealing with this..
Here's the solution I gathered from web:
1. Check that you have USB de-bugging on under the development settings of your phone
2. Check that you have your sdcard partitioned to at least ext3.
3. Check that you did not rename your nandroid folder, nandroid's content to anything fanciful.
4. Check that you have enough power on your phone, at least 30 percent to be safe. Low power will disable the ability to do a restore in some cases.
Well if you don't have the above:
1. Go enable USB de-bugging under settings>manage applications>development>USB Debugging>activate.
2. Transfer whatever content you have on sdcard to somewhere safe. Then do a proper partitioning via the recovery, upgrade it from ext2 to ext3. Repair the ext in case there are some errors. After this, transfer all contents back.
3. Please rename all folders back to their original name, and don't rename them ever again.
4. Charge your phone with AC supply, and wait till it is at least 30 percent and try to do a restore again via recovery, if not, do step 1 - 3.
Trying to do a restore:
1. Do it via recovery, if everything is fine, it should go smoothly, and you got your upper hand back!
2. If you like to see words running in strings, doing via console is possible too!
-
"quoted from and credit to Slug from android forums"
Open a command prompt window (Start-All Programs-Accessories-Command Prompt)
Type cd/ and hit <enter>
Enter cd adb
Now enter adb devices and it should show "000000000000 recovery"
If so, enter adb shell and you should see the prompt change to #. You're now running as su (root)!
Enter nandroid-mobile.sh --restore. You'll see instructions about "Using G1 keyboard..." disregard and hit <enter>.
After a brief search, the default (most recent) backup found will be displayed along with any others located. If the default choice isn't the one you want to restore, you'll have to enter the full path to the correct one as displayed in the list. You can use the Edit...Mark... function from the command prompt window menu to simplify this, though. Put the cursor at the beginning of the required line, hold <shift> and highlight the test using the arrow keys. <Enter> copies to the clipboard, and Edit... Paste... places it wherever the cursor is placed.
Once you have the correct backup referenced, hit <enter> and you should see the script work its magic.
When Restore done is displayed you can reboot the handset from the recovery menu.
Alright you have got your restore back! Feedback or anymore tips to this problem are welcome! Thank you for your time.
JokerAce
so if we renamed the nandroid backup to something we will remember more easily, and that the problem, what do we do?
edit: how do we know what the original name of the backup was called.
Hi, did you get a Md5 mismatched or something? Please be clear with your problem. If it's a mismatch problem, make sure your rename'd folder has NO Space in the name.
hello, i want to do adb backup on my n4 with PA 3.50. I write
Code:
adb backup -apk -all
on the terminal,
i unlock the screen but i can't push the confirm button! i can only set the password or exit.
can somebody help me?
I sadly dropped my nexus 4 on hard tiles yesterday face down and the whole front cracked everywhere! The phone still turns on, I can copy internal storage off fine, but since the touchscreen doesn't work anymore I'm having trouble with getting system data off e.g. sms.
I've managed to get non touch CWM installed, made a nandroid, but now I can't copy the damn thing off! ADB gives me unauthorised for every command, and obviously I can't use the phone to authorise my PC. Am I now essentially screwed? Been googling for ages and can't find a way round the fact I can't use ADB or force my phone to authorise my PC without using the screen.
Any other ideas would be massively appreciated. The phone is rooted, CM10.2, and luckily usb debugging is enabled.
Cheers!!
You said you can copy internal storage right? so why not pull the nandroid from /clockworkmod/backup?
Sent from my Nexus 4 using Tapatalk 4
I do not use CWM, but I do use TWRP and it allow me to access to the /data and /sdcard partition just fine, /system is off limit though. I don't know where your nandroid is backed up in, but I assume its in /sdcard.
Try this: Flash TWRP in fastboot mode, then press the volume button either up or down twice, then press Power to access the recovery. Then on the main menu of TWRP, you can do adb commands right away.
I can then simply back up my whole /sdcard partition by: adb pull /sdcard/ C:\backup
Or backup the all the apps data: adb pull /data/data/ C:\backup
Thank you both for the advice. I've tried using adb in recovery, but it says: remote object '/sdcard' is not a file or directory.
If I type adb devices, I get my phone ID along with 'recovery' next to as expected.
Any ideas?
Thanks.
EDIT: Ignore this, just added a / after /sdcard and now its pulling ok. Thanks so much!
I was typing this up before I read your edit:
If you don't know where certain files are, you can type "adb shell" to enter the phone itself, there you can look at the phone directory structure and find where your files are located.
Use the cd and ls commands to navigate in the phone: http://afrodita.rcub.bg.ac.rs/~ivica/nlm/part1/cd_ls.html
Once you're done, type "exit" to get out of adb shell. Then you can use the "adb pull" command to copy the files.
Hi,
Thanks in advance for reading this.
Details:
Phone: Google Nexus 4
OS: Android 4.4.2
Android SDK OS: Windows 7x64 SP1
adb version: 1.0.31
Eventually I hope to unlock the bootloader and then root my phone, but right now I'm struggling with making a backup and until I get that accomplished I don't feel comfortable going any further. I hope that someone here more knowledgeable can point out what I'm doing wrong.
Long story short, I fully charged the Nexus 4, updated the existing Android SDK so I'm using the latest version of adb and installed the Google USB drivers by choosing to install "legacy" devices and selecting all three drivers (one at a time). I then removed the fake legacy devices and chose to leave the drivers installed.
I then connected the Nexus 4 in USB debugging mode and it was detected via
Code:
adb devices
. I read here about using
Code:
adb pull /sdcard/ /sdcard/
and translated that to:
Code:
adb pull /sdcard/ .\sdcard
since I am on a Windows box. That worked fine until a subfolder within /sdcard/Android for the Amazon Kindle app was encountered. The copy attempt was aborted due to a filename that I'm guessing the NTFS filesystem didn't care for.
I figured I would just move past that and come back to it later; maybe use ES File Explorer to create a zip file or copy/paste specific folders via Windows Explorer interface.
I then moved on to running adb backup and ran:
Code:
adb backup -apk -shared -all -f .\nexus4-backup-010114.ab
After a long while the command appeared to complete and control was returned to the command prompt. The resulting file was about 1 GB in size and no errors were shown on the phone or on the command prompt by adb.
Not one to trust just one run, I tried it a second time and the process hung. I cancelled the adb call and ran
Code:
adb reboot
to reboot the phone. I tried again and the process hung yet again.
I've tried all of the following and the process seem to hang (waited several hours one time):
*
Code:
adb backup -apk -shared -all -f .\nexus4-backup-010114.ab
*
Code:
adb backup -apk -shared -all -nosystem -f .\nexus4-backup-010114.ab
*
Code:
adb backup -apk -noshared -all -nosystem -f .\nexus4-backup-010114.ab
and based on the suggestion here I tried with and without an encryption password. The first attempt was without a password and later attempts was with providing a password at the time of the backup (when prompted on the phone).
Before posting this, I tried setting a password within the Developer options on the phone and had the same luck with running:
Code:
adb backup -apk -shared -all -nosystem -f .\nexus4-backup-010214.ab
By this point I'm ready to throw the phone against the wall (even if it doesn't deserve it). Any help would be appreciated.
Thanks!
I ended up giving up on this as I've spent three days and didn't want to wait any longer. I backed up the contents of /sdcard/ into a zip file (using ES File Explorer) and will restore contents manually as necessary.
I've since unlocked my phone, restored quite a bit of content, taken two Nandroid backups (before and after rooting the phone) and loaded all currently available versions of stock Android for the Nexus 4. What follows is some of my notes that I took while going through the process.
---
After unlocking my phone I restored contents from the zip file and a surprising amount of content was restored, but unfortunately not stuff like bookmarks and other personal settings. As I read before and after unlocking my phone a lot of that content is kept in /data where only root can get to it. Thankfully not all app developers follow that recommendation and I was able to retrieve some of my content.
However after I unlocked the bootloader and rooted the phone I was able to make a backup by running:
Code:
adb backup -apk -shared -all -f nexus4-backup-010414.ab
I'm not sure if it was just unlocking the bootloader that allowed it to work or that + rooting the phone or maybe something else entirely. Whatever the case that command completed successfully. I'm going to run several more backups with differing options and then will flash the phone back to stock and try restoring from that.
Just before that I'll try making a backup via TWRP (haven't really looked into the details yet) and also follow the codemink.com/backup-or-restore-android-through-adb/ guide to try and make a backup of the entire phone (OS, Recovery, etc).
I'm hoping I don't have to spend all of my time restoring the phone from scratch if this doesn't work, but it's worth trying this to find a reliable solution.
---
I picked another tool from the tool chest and tried using the Nexus Root Toolkit (NRT) v1.8.0 since others have recommended it. I know it's not good to rely on toolkits, but I wanted to see what it was capable of. It rebooted the phone into bootloader mode and then booted a custom recovery (TWRP) so it could run a Nandroid backup. It did and ended up with a 2.30 GB backup located at /sdcard/TWRP/BACKUPS/SerialNumberOfYourPhone/. From what I can tell the NRT automates what you can do manually, only when it finished the process and attempted to copy the backup to the PC it only grabbed about 40 MB worth and reported a successful backup.
Since I had been watching the process from the phone I saw that it reported the size of the data it was backing up as 2750 MB, so I knew that the NRT was wrong. It asked if I wanted to nuke the backup since it copied it over, and I told it No since I knew it was wrong.
* If I haven't mentioned it yet, I used Windows 7x64 for all steps.
---
I followed the directions on the www .android.gs/root-google-nexus-4-on-android-4-4-kitkat-krt16o-rom-using-twrp/ page and didn't have any problems. Well, the one problem I did have was not freaking out when my Nexus wasn't seen by either
Code:
adb devices
or
Code:
fastboot devices
.
I frequently made the mistake when experimenting on my own by using one or the other when it wasn't appropriate. I ended up learning that fastboot is used when interacting with the bootloader and adb is used when the phone is booted into the full Android OS or in Recovery mode.
After I had TWRP installed, the Android 4.4.2 installation rooted (again using the www .android.gs/root-google-nexus-4-on-android-4-4-kitkat-krt16o-rom-using-twrp/ page and my phone setup the way I wanted it, I took a final Nandroid backup using TWRP and then booted the phone back into the full OS.
I proceeded to copy the /sdcard/TWRP backup files to the PC as a precaution. I ended up using the developers.google.com/android/nexus/images#occam official factory images for the Nexus 4 to flash Android 4.2.2 all the way up to Android 4.4.2 "just to do it". Restoring my TWRP backup first required me to re-flash TWRP and then copy the TWRP backup folder back to /sdcard/TWRP. I booted back into Recovery mode via adb reboot recovery and used the menu system to drill down to the backup I was interested in and restore it. I then rebooted when prompted and my phone was restored to where I last made a Nandroid backup.
I took extensive pictures using a second phone and kept all output so I could have something to refer to if (uhm, when) I try this again in the future.
What I learned at the end is that I could have flashed just the OS by modifying the flash-all.bat file to remove the -w switch from the final fastboot command in the file. Here is what it looks like by default for the file included in the Android 4.2.2 factory image tarball:
Code:
fastboot -w update image-occam-jdq39.zip
and after removing the switch:
Code:
fastboot update image-occam-jdq39.zip
Using that approach I would likely be able to safely keep the /sdcard/TWRP files on the phone during the flashing of stock roms. I hope this helps someone. Unfortunately I never did find a way to use adb to make a successful backup prior to unlocking the bootloader, so if I had it to do all over again I would have unlocked the bootloader when I first received it. Lesson learned!