I have used ADB to backup data and apps on all of my devices for a couple of years. It is very reliable and the backups for individual app can be restored across devices without issue. It is preferable to using Titanium Backup, especially since that program is no longer reliable since the inception of A12. It is especially handy when the device is not rooted. But until recently, it always worked whether the device is rooted or unrooted. Today, while preparing to install the latest A12 update on my T870, I attempted do a backup of my favorite game, it would go through the motions and create the backup file. However, I knew immediately that the file was not correct because it was only 1K in size. The same game on my phone creates a 500 Mb file. My tablet was rooted using the Magisk/boot.img method but that hasn't made a difference in the past on any device. I wasn't overly concerned because I tested restoring the phone version of the backup to my tablet and it worked just fine. I went ahead and did a clean install of the latest A12 update, debloated my tablet and restored my backups via. ADB. everything is copacetic. The only difference is I did not root my tablet this time. I suspect if I do I will have the same issue. Not a big deal since rooting holds much less importance for me than it once did.
Command used to backup - adb backup -apk com.crossword.bible.cookies.find.english -f com.crossword.bible.cookies.find.english.adb
Restore command - adb restore com.crossword.bible.cookies.find.english.adb
Same commands used in both the successful and unsuccessful backups.
Thoughts anybody?
Related
Hi there,
I had been on Android 5.0.1 and HATED it. It has so many issues with it that I decided to go back to 4.4.4 using fastboot.
I backed up my device using ADB beforehand, and then loaded the KitKat OS. Once I'd done I tried to restore my backup, and for some reason it won't let me because it's a different android version...
I used the command "adb backup -apk -shared -all -f c:\users\user\filename.ab" when backing up.
Has anyone got a way round this, or am I going to have to go back to 5.0.1, restore the backup, copy as much as I can to my computer without that backup method, then sideload back to 4.4.4 again? That's so long winded!
TY
droidsmanmk2 said:
Hi there,
I had been on Android 5.0.1 and HATED it. It has so many issues with it that I decided to go back to 4.4.4 using fastboot.
I backed up my device using ADB beforehand, and then loaded the KitKat OS. Once I'd done I tried to restore my backup, and for some reason it won't let me because it's a different android version...
I used the command "adb backup -apk -shared -all -f c:\users\user\filename.ab" when backing up.
Has anyone got a way round this, or am I going to have to go back to 5.0.1, restore the backup, copy as much as I can to my computer without that backup method, then sideload back to 4.4.4 again? That's so long winded!
TY
Click to expand...
Click to collapse
BUMP?
I guess I'll have to just take off all my photos, videos, app backups and music off bit by bit, then go back to 4.4.4 and copy them back over.
Ahh well.
Long Story Short: On a CM12(Nightly) Moto G(Falcon) that had to be thoroughly reformatted after an unexplained disaster, I'm trying to use a TWRP backup made earlier and ensconced on my computer to restore my phone. After using the backup function once to establish the filepath, I transfer the backup to the backups folder in TWRP and use the restore function. At first, it said that it was a f2fs backup or something, but after reformatting to match it just hangs when trying to restore the data folder(without a specific error), and throws a "Failed" message. Backup doesn't work, phone gets one step closer to being launched out the window. I've thoroughly reformatted everything, reflashed recovery, and double checked all the catches I know of(the backup is under 2.5 gb for instance).
I'm stumped. Should I give up at this point? Is the backup just gone(especially given that it's connected to how this all got started)? Is there nothing I can do with having captured all the folders onto my PC?
(Full story)
While fiddling around with Moto G 2013(falcon/xt1032) running CM12 Nightly this morning I decided I should take a backup with TWRP (which I had also specifically installed this morning because of rumors of it working with encryption). The moment after I rebooted from the (supposedly successful)backup, my phone got stuck in a nasty bootloop, would even reboot from attempting to start recovery half the time. After a lot of cursing and trial and error I successfully formatted everything and reinstalled TWRP, and that stopped.
I had even managed a mass evacuation of my files (simply dragging everything off with windows explorer) to my computer. This included that fateful backup that TWRP made, that didn't seem to be worse the wear. There are some things on here that I'd rather miss (especially since I just cleaned out my PC based backup program yesterday), so I'm trying to restore my phone from there.
Over the course of the last two years I have flashed the *expletive deleted* out of my Nine and gone through the set up countless times, because I wanted to, and mostly with childlike enthusiasm. Sometimes, like today, it's because I have to. I seem to fail more often than not restoring from TWRP, and recently sometimes with flashfire free version. I never seem to have a problem "testing" the backups after creation, without any major changes they restore without issue. My problems seem to arise after flashing a new rom or preview and then trying to revert back to my previous restores. More often than not these fail on me and I find myself , like today, looking at the set up screen.
What ways (free) work best to save/restore roms, and what the hell am I doing wrong with my back ups? I have a basic grasp of ADB/fastboot. But it appears I have just enough info to be dangerous.
I blame the Vendor partition...
I've not had any problems with TWRP and restoring. I will add, however, that I don't backup the vendor partition. I have had problems with that before. I don't seen any real need to back up the vendor partition, though, so I just exclude that. I keep copies of the vendor image for the ROM that I flash. If I need to restore a backup, I restore it and then flash the original vendor image for that ROM version again.
I don't back up at all any more now that Google is able to reinstall all your apps when performing a fresh install. Just install the rom, choose the restore and let Google do its thing whilst I crack on with other things.
I've had several issues with TWRP backups on 6.x and 7.x, so now I use FF over ADB to make a "NORMAL" backup to my PC. I also use TiBu for apps and store a zip file of the complete TiBu folder on my PC.
I used to use TitaniumBackup to transfer apps and data from one Android phone to another when both devices are rooted. Recently I got a phone which currently does not have root access, so TitaniumBackup would not be useful. Most apps are not an issue, but I have trouble transferring a few apps and their data.
I was thinking to use adb to backup each app+data separately on the old phone (and then to restore it in the new phone), and tried the following command on the old (and rooted) phone:
adb backup -f <appname>.ab -apk <app_package_name>
but I got the following message:
Now unlock your device and confirm the backup operation.
The strange thing is that there is nothing there for me to accept when I unlock the phone or when I keep the phone unlocked.
Also when backing up all apps via "adb backup -apk -shared -all -f all.ab", I still get the same message: Now unlock your device and confirm the backup operation. And this happens on two computers I have tried so far. Very weird.
I just tried another phone, and had no problem with the adb backup command (I did see the confirmation request on the phone). So the problem seems to be with this particular phone (LG G2 with root).
Any suggestions as to how to handle the transfer? Any better alternatives to transfer a few apps+data from one phone to another?
How to recover data from "adb backup --twrp" archive? Been through hell and back
I have two backups I made using "adb backup --twrp" while my OnePlus one phone was in TWRP recovery 3.2.1-0 running LineageOS with a recent build (don't know exactly which one, but it was from Feb/March 2018). Each of the backups are about 6.0GB so they appear to be complete backups. I am trying to recover one app and its data (Signal/Textsecure) but the rest would be nice too. The backup files have .ab extensions. I am fairly android savvy and have been working on this for days, your help is VERY MUCH APPRECIATED! I have access to Windows and Linux.
I have tried the following:
-"adb restore filename.ab" while in TWRP recovery. It appears to restore (progress bar goes, it reports success, etc), but no apps are restored. I have tried this both with totally wiped partitions/system/data and with a fresh install of LineageOS. As far as I can tell, nothing happens. When doing a restore after a full wipe and trying to restart, TWRP warns that no OS is installed.
-Restoring using the restore menu in TWRP. Immediately upon clicking on the backup, the phone restarts and TWRP opens again. Not sure what's going on there.
-Opening the backups in Titanium Backup, Nandroid manager, and a few other apps. None of them worked. Titanium backup crashes instantly in recover from ADB, doesn't recognize the backups in nandroid recovery mode.
-Opening the .ab files in an archive manager, all of which report it isn't a valid tar archive. One time I was able to get a list of directories, and things looked pretty right, so I know at least some of the data should be there. Running variants of this command with different skip values, none of which produces a valid tar file dd if=file.ab bs=512 skip=1 of=test.tar
Questions:
- Is there a way to extract data from these backups in Linux or Windows outside of Android? From what I read, TWRP adds some stuff in the headers which makes them invalid tar files, and that doing "adb backup --twrp" is different from a regular TWRP backup.
- Why is TWRP crashing? Is there a log I can look at for this and how? Maybe i can find a way to diagnose it that way.
- Where does Signal store message data? I have a flat-file backup that may have this information depending on where it's stored.
- Can I somehow convert these backups to a different format that might be better-tolerated by TWRP or other apps?
- Any good utilities for reading a corrupted tar file? I think all this utility would need to do is skip through the junk at the start.