Way to backup and restore from PC (no root)? - Google Pixel 2 XL Questions & Answers

At the moment I dont' want to unlock,root the phone and install TWRP because I'm fine with stock Rom, but there's a way to backup to pc and restore from pc as we can with TWRP recovery?
Thanks

failax said:
At the moment I dont' want to unlock,root the phone and install TWRP because I'm fine with stock Rom, but there's a way to backup to pc and restore from pc as we can with TWRP recovery?
Thanks
Click to expand...
Click to collapse
ADB Backup
https://9to5google.com/2017/11/04/how-to-backup-restore-android-device-data-android-basics/
Google search link with 1.590.000 hits
My command line is:
Code:
adb backup -apk -shared -all -system -f C:/user/Pixel2XL/adb_backup/mmddyy.ab
This backs up all user apps and data, all system apps and data, and shared storage (internal SD card)

Pkt_Lnt said:
ADB Backup
https://9to5google.com/2017/11/04/how-to-backup-restore-android-device-data-android-basics/
Google search link with 1.590.000 hits
My command line is:
Code:
adb backup -apk -shared -all -system -f C:/user/Pixel2XL/adb_backup/mmddyy.ab
This backs up all user apps and data, all system apps and data, and shared storage (internal SD card)
Click to expand...
Click to collapse
Actually, you might want to include
Code:
-obb -keyvalue
*if you want to backup your games and any "apps that perform key/value backups"
What a great idea @Pkt_Lnt! I wish I realized this when I was planning to root and wanted to backup as best I could...
I'm purely just wondering, why include "-apk -shared" & "-system" when you have an option of "-all"? And isn't including "-f" meant to backup a specific file?
P.S. nevermind (on the -all & -system), after reading the help on the command, -all doesn't cover system apps...
Also, in terms of restoring.... would this method depend on root access for full restoration? does this method even backup settings and "personalizations" without root access (at least when backing up)?

simplepinoi177 said:
Actually, you might want to include
Code:
-obb -keyvalue
*if you want to backup your games and any "apps that perform key/value backups"
What a great idea @Pkt_Lnt! I wish I realized this when I was planning to root and wanted to backup as best I could...
I'm purely just wondering, why include "-apk -shared" & "-system" when you have an option of "-all"? And isn't including "-f" meant to backup a specific file?
P.S. nevermind (on the -all & -system), after reading the help on the command, -all doesn't cover system apps...
Also, in terms of restoring.... would this method depend on root access for full restoration? does this method even backup settings and "personalizations" without root access (at least when backing up)?
Click to expand...
Click to collapse
1 - I was trying to teach the poster above to fish, not trying to do the fishing for him. That said, I'm not a gamer, that "-obb" is not relevant to me.
2 - backup -f file Write an archive of the device's data to file.
This Reference
I do not see your "-keyvalue" in that ADB Command Reference doc, you might want to verify that before using it.
This is my actual command line from today. I'm on Linux, so I tried to make this easier for the Win crowd, knowing the tilde_backslash_path would throw 99% of those who might read this for a loop!
Code:
[email protected] ~ $ adb backup -apk -shared -all -system -f ~/Pixel2XL_adb_backup/backup05172018.ab
3 - ADB commands to not require root. Restore has always worked for me, and as you might guess, I have many "adb grant permissions" in use. :good:
For the rest of your questions, sorry I don't have time to do that research for you. All I use is the This Reference above, if that does not provide what you are asking, try this.

Pkt_Lnt said:
1 - I was trying to teach the poster above to fish, not trying to do the fishing for him. That said, I'm not a gamer, that "-obb" is not relevant to me.
2 - backup -f file Write an archive of the device's data to file.
This Reference
I do not see your "-keyvalue" in that ADB Command Reference doc, you might want to verify that before using it.
This is my actual command line from today. I'm on Linux, so I tried to make this easier for the Win crowd, knowing the tilde_backslash_path would throw 99% of those who might read this for a loop!
Code:
[email protected] ~ $ adb backup -apk -shared -all -system -f ~/Pixel2XL_adb_backup/backup05172018.ab
3 - ADB commands to not require root. Restore has always worked for me, and as you might guess, I have many "adb grant permissions" in use. :good:
For the rest of your questions, sorry I don't have time to do that research for you. All I use is the This Reference above, if that does not provide what you are asking, try this.
Click to expand...
Click to collapse
Cool...thanks for answering what you could...I was merely curious; I didn't mean/intend/imply that you do the research for me or anything. Yea, I know absolutely nothing about Linux and it's environment; so I/we appreciate you converting it to the "windows crowd" as well as "spelling it out" for me in the format you wrote it all out in your post. I, myself, have root and use TWRP for the backups...I was just trying to expand the knowledge...
Thanks again!

Related

[How to] Recovery through adb

At this point there's no way to have full recovery backups through CWM. adb allows us to do almost the same.
Here's how:
Code:
$ adb shell
$ su
# stop
# busybox tar cf /mnt/external_sd/data.ext4.tar --exclude media --exclude dalvik-cache /data
# reboot
To restore:
Code:
$ adb shell
$ su
# stop
# busybox tar xf /mnt/external_sd/data.ext4.tar -C /
# reboot
This will not backup the internal sdcard "/data/media" it's likely too large, so it should be backed up manually.
tar is the same format CWM uses, so it should restore from Titanium Backup.
thanks for this! Every little bit helps.
eww245 said:
At this point there's no way to have full recovery backups through CWM. adb allows us to do almost the same.
Here's how:
Code:
$ adb shell
$ su
# stop
# busybox tar cf /mnt/external_sd/data.ext4.tar --exclude media --exclude dalvik-cache /data
# reboot
To restore:
Code:
$ adb shell
$ su
# stop
# busybox tar xf /mnt/external_sd/data.ext4.tar -C /
# reboot
This will not backup the internal sdcard "/data/media" it's likely too large, so it should be backed up manually.
tar is the same format CWM uses, so it should restore from Titanium Backup.
Click to expand...
Click to collapse
I've not tried this yet, but am wondering what and where the output file would be located. Would you be able to use this as a recovery method from one ROM to the saved ROM similarly to what is done with CWM?
tomlogan1 said:
I've not tried this yet, but am wondering what and where the output file would be located. Would you be able to use this as a recovery method from one ROM to the saved ROM similarly to what is done with CWM?
Click to expand...
Click to collapse
For the instructions posted an external sdcard is needed it would be in the root of the card. You can substitute external_sd with sdcard to save in to the internal memory.
And yes this can work just as CWM when switching ROMs. For example before upgrading to ICS. Then, if possible, flash back to Honeycomb and restore the backup.
eww245 said:
For the instructions posted an external sdcard is needed it would be in the root of the card. You can substitute external_sd with sdcard to save in to the internal memory.
And yes this can work just as CWM when switching ROMs. For example before upgrading to ICS. Then, if possible, flash back to Honeycomb and restore the backup.
Click to expand...
Click to collapse
Just to make sure I have done this, correctly, I have a file on my external sd called data.ext4. Should I wish to try another ROM, I would load the new ROM via the normal recovery method, and then if I wanted to restore from the data.ext4 file, I would use ADB to restore this file. Would this overwrite the existing ROM so I could , for instance, use ICS and then move back to HC? Looking at the data.ext4 file, it appears that all the applications have been backed up as well. Am I correct? Thanks.
tomlogan1 said:
Just to make sure I have done this, correctly, I have a file on my external sd called data.ext4. Should I wish to try another ROM, I would load the new ROM via the normal recovery method, and then if I wanted to restore from the data.ext4 file, I would use Titanium backup to restore this file and then use Titanium to also restore applications and data that I has backed up previously. Am I correct? Thanks.
Click to expand...
Click to collapse
Currently no one has made any roms, I guess because of no CWM which isn't needed, Theres only stock HC and stock ICS. Unfortunately ICS CAN'T be downgraded back to HC, previously I saw no mention of it being possible or not. Titanium backup is capable of restoring apps and data from a nandroid / tar. Which I don't own so I can't test it. Lets say you start getting a bunch of Force Closing apps and you have already made a tar backup. Then just fire up adb and restore it. Or you want to factory reset and start fresh, then install individual apps/data through Titanium from the tar, if even possible.
AppExtractor can also restore app data from a nandroid. Well, it doesn't work with my adb backup on the a100 but if I copy it to my phone AppExtractor has no problem reading the archive. I don't know about Titanium.
[edit]Just want to add to this post because it is actually possible to downgrage to HC. crossix has instructions here forum.xda-developers.com/showpost.php?p=22970185&postcount=147.
Also peporras opened a thread about it forum.xda-developers.com/showthread.php?t=1517286
eww245 said:
Currently no one has made any roms, I guess because of no CWM which isn't needed, Theres only stock HC and stock ICS. Unfortunately ICS CAN'T be downgraded back to HC, previously I saw no mention of it being possible or not. Titanium backup is capable of restoring apps and data from a nandroid / tar. Which I don't own so I can't test it. Lets say you start getting a bunch of Force Closing apps and you have already made a tar backup. Then just fire up adb and restore it. Or you want to factory reset and start fresh, then install individual apps/data through Titanium from the tar, if even possible.
AppExtractor can also restore app data from a nandroid. Well, it doesn't work with my adb backup on the a100 but if I copy it to my phone AppExtractor has no problem reading the archive. I don't know about Titanium.
Click to expand...
Click to collapse
I know there are no custom ROMS. If I wanted to try ICS, there there is no way to flash one of the stock ROMS back? Just wanted to be sure before I do something I would regret.
Thanks.
I am new here so sorry for this newbie question, I have tried the method in post 1 but I get the message tar: empty archive have I missed something? any help will be greatly appreciated. Many thanks in advance.
I have re-typed the commands and all seems ok.
Your not specifying any files to be tarred. The command should end with /data
eww245 said:
Your not specifying any files to be tarred. The command should end with /data
Click to expand...
Click to collapse
many thanks
eww245 said:
At this point there's no way to have full recovery backups through CWM. adb allows us to do almost the same.
Here's how:
Code:
$ adb shell
$ su
# stop
# busybox tar cf /mnt/external_sd/data.ext4.tar --exclude media --exclude dalvik-cache /data
# reboot
To restore:
Code:
$ adb shell
$ su
# stop
# busybox tar xf /mnt/external_sd/data.ext4.tar -C /
# reboot
This will not backup the internal sdcard "/data/media" it's likely too large, so it should be backed up manually.
tar is the same format CWM uses, so it should restore from Titanium Backup.
Click to expand...
Click to collapse
If you changed "data.ext4.tar" to "nameilike.ext4.tar" you would then be able to have a catalog of different setups you made, assuming some other ROMS in the future. The reason for this is the previous generation of CWM on the A500 used the date for the file name and if you had 5 or 6 you didn't know which was which.

[Q] adb backup sizes?

Hi,
I'm just trying to backup my HOX to do a post-JB factory reset. I'm a bit concerned about the size of backup files I'm getting from adb - they seem very small!
adb backup -apk -all -nosystem -f backup.ab
for example, gives a backup.ab file of 253Mb. Can that be right? I understood those flags would include all non-system apps (not on the phone storage), not just their settings, and I'd have expected a lot more than that. Storage in Settings tells me I'm using 6.xxGb of "app storage" and about 4Gb of the 25Gb phone storage.
I know actual figures depend on personal usage, I just wanted to know whether people thought those seemed like correct ballpark figures.
adb would seem to be my only option real option since I don't want to root until I'm out of warranty.
Thanks,
Allan
That's only the system partition and it sounds about right.
To fully backup your phone you would want system, data, boot, and sdcard (not usually done as it's not erased for most things).
(Easiest way I know is to a backup like that using CWM or TWRP recoveries)
Thanks, that's reassuring that it doesn't seem anything's wrong with the backup.
I'd really rather not root to use any of the more powerful backup solutions but I recognise that means I'm more limited with what I can do.
I think I'll rebackup with adv to cover the last few days and then just go for it.
Thanks again!

[Q] [How to] Save the just data from specific apps

Hello guys!
I want to format everything and give a fresh start on my GNexus. I am finding it very laggy and I think that the problem is on using the same app backup for almost an year. I make the full backup in the recovery and after wiping everything and installing a new rom, I restore everything. I believe that there are many apps in my phone that I don't use anymore and are there as trash that needs to be cleaned...
I know about Titanium Backup, but I'm on ART and I never learned how to use the damn program correctly, so there is much complication to just backup some apps. What I really need is a method for backing up JUST the data (ex: the savedata from the games) and not the apk. So that I can wipe everything in the phone (all the partitions), install the rom and fixes and everything and then intall via google play the apps again and put the backed data in its place again.
I don't know if I made myself clear, maybe I'm just complicating, but if you play or played roms on an emulator, you have the rom and its save. I want to backup the save file, delete the rom and the emulator itself. Then install the emulator again (clean install), donwload the roms (clean ones) and put the old save in the place. :good:
Well, thanks in advance :laugh:
Rayaxe said:
I know about Titanium Backup, but I'm on ART and I never learned how to use the damn program correctly,
Click to expand...
Click to collapse
Titanium works on ART now, as is my understanding. It's not complicated to learn. Just select the app and hit backup, and Bingo Bango, you're done.
Then when you restore, you can select just data.
Piece of cake, ace.
yeah, I finnaly made it, my problem was ART, I didn't notice they updated the app ehehe
thanks
Yeah I personally don't recommend tibu. I've tried it myself and had issues related to Android version at the time and I just see this over and over. The other thing is that there are excellent options available without an app. My favorites for backing up just /data/data/<app_data_dir> are:
Code:
#> cp -a /data/data <backup_location>
OR you can use
Code:
#> adb backup -noapk -all
Type adb in terminal on phone or on computer to see more info for this one, that's basically it though. You can use adb to backup directly onto your phone or computer, very useful when you need some space!!
The most important thing though when you're backing up data is to preserve permissions and be able to set new ones for data if the apk owner "id" changes, e.g. app re-installations. Otherwise you'll run into some pretty bad problems.. not so fun. So definitely use a tar archive for file permissions preservation and some fast lzma lzop compression on top of the tar archive. 'busybox tar' usually has all of these options. A lot of roms' busybox and functions get stubbed and made useless, so I would check out Terminal IDE if you want to go this route. 'Definitely want the full gnu options and consistency. Vanir by itself is also good here, and I use it 24/7 for this reason. It really does have a hemi, they're not kidding.
7175 said:
Yeah I personally don't recommend tibu. I've tried it myself and had issues related to Android version at the time and I just see this over and over. The other thing is that there are excellent options available without an app. My favorites for backing up just /data/data/<app_data_dir> are:
Code:
#> cp -a /data/data <backup_location>
OR you can use
Code:
#> adb backup -noapk -all
Type adb in terminal on phone or on computer to see more info for this one, that's basically it though. You can use adb to backup directly onto your phone or computer, very useful when you need some space!!
The most important thing though when you're backing up data is to preserve permissions and be able to set new ones for data if the apk owner "id" changes, e.g. app re-installations. Otherwise you'll run into some pretty bad problems.. not so fun. So definitely use a tar archive for file permissions preservation and some fast lzma lzop compression on top of the tar archive. 'busybox tar' usually has all of these options. A lot of roms' busybox and functions get stubbed and made useless, so I would check out Terminal IDE if you want to go this route. 'Definitely want the full gnu options and consistency. Vanir by itself is also good here, and I use it 24/7 for this reason. It really does have a hemi, they're not kidding.
Click to expand...
Click to collapse
looking for this method, very nice!
thanks, next time I need to backup I will use this xd

How to copy /data partition from HTC One M8?

My HTC ONE M8 battery died and all SMS messages disappeared.
I badly need them back.
So my idea was:
1. to have a block by block backup of /data partition to a Linux or Windows box.
2. use some standard tools trying to find missing or corrupted or deleted files there. Find the one which has the messages.
3. extract the messages using something like mmssmsxml.py in the SMS Backup/Restore format and bring it back to the phone.
Unfortunately at this point I am still at #1 since this requires Rooting the device and rooting according to all posts is going to delete all data. So my questions are:
1) Can I do a "partial rooting" to just unlock /data partition?
This would give me opportunity to dd all data from the partition.
2) are there any other methods? Maybe the standard Unix/Linux way of booting a limited OS image (consisting of: boot, mount, parted, dd ...) so I could boot from SD and run the dd command and copy /data partition to the SD card and then bring it to the Linux computer.
Please help.
No way to do this that I know of, unless you happen to already by s-off: http://forum.xda-developers.com/htc-one-m8/help/root-losing-data-s-off-t3457817
redpoint73 said:
No way to do this that I know of, unless you happen to already by s-off: http://forum.xda-developers.com/htc-one-m8/help/root-losing-data-s-off-t3457817
Click to expand...
Click to collapse
So, is there a way to S-off the phone without wiping it out?
You can use ADB to make a backup without root.
adb backup -apk -shared -all -f C:\Users\NAME\backup.ab to backup everything. Replace "NAME" with your Windows username.
adb restore C:\Users\NAME\backup.ab to restore the backup, replacing "NAME" again, of course.
You can read more about it in this thread.
I have not used the adb backup but I was told, that it backs up only files. The new mmssms.db exists in the file system and currently has no messages. I need to have the full image of the partition in order to search all block marked "empty" which could potentially be blocks of the damaged (and disappeared) mmssms.db file in order to re-construct the file and get all sms messages from it. The new mmssms.db exists in the file system and currently has no messages.
Please correct me if I am wrong and I will be able to search the adb backup for missing blocks.
Regards.
Vladimir
rubashev said:
I have not used the adb backup but I was told, that it backs up only files. The new mmssms.db exists in the file system and currently has no messages. I need to have the full image of the partition in order to search all block marked "empty" which could potentially be blocks of the damaged (and disappeared) mmssms.db file in order to re-construct the file and get all sms messages from it. The new mmssms.db exists in the file system and currently has no messages.
Please correct me if I am wrong and I will be able to search the adb backup for missing blocks.
Regards.
Vladimir
Click to expand...
Click to collapse
I really don't know. I've never had a problem like this myself, but I thought I would suggest it as it's the only way to backup without a custom recovery that I know of. To flash a custom recovery you need to unlock your bootloader first, and that will wipe your phone.

Backup and Restore with adb

Since we do not have TWRP, our options for backing up and restoring our data is limited. I use Titanium Backup Pro, but recently ran into issues with libmtp when trying to copy the ttbu folder from my sdcard to my computer. So I decided to use adb backup and restore instead. It worked very well, so I decided to write some scripts to make it easier. Now I will share them here.
These scripts were written in Linux and meant to be used in Linux. If you are versed in scipts for windows (.bat), please feel free to use my scripts as a guideline.
You can clone the repo here
android_backup_restore​
Before doing anything, I strongly suggested reading the README.md first.
The scripts are a little rough right now, as they are a WIP. But they work just fine.
Hi ! Thanks for the thread. It's possible toi use it on OsX ? I do to convert script for run on terminal ? Or just use shell ? I'm not an expert. Thanks

Categories

Resources