[Q] Backing up and restoring with ADB - OnePlus 3T Questions & Answers

Hi everyone,
I wanted to unlock the bootloader on my OP3T but I don't want to lose all the data. So I wondering if I could back my phone with the command,
adb backup -all -apk
and then unlock the bootloader and then restore the backup that I made. Are there any disadvantages to this? Will I lose out on updates? Will I lose any data? Anything else I should know?

I think you will in the end need root via adb to accomplish this. Imagine this, if without unlocking phone you can use adb to make a backup then anyone can do that(who have enough knowledge) and this can be a major security concern.
Soo I think it is not possible.

It is possible. As stated on Titanium Backup's webpage:
1. How to make your first backup WITHOUT root:
Before beginning, you need to setup your ADB and have your device detected. You must also running Android version 4.0 and above. Also, make sure you have a file manager installed. Our favorite is the ES File Explorer.
Connect your device and make sure its listed with the following command:
Code:
adb devices
Run a FULL backup with the following command:
Code:
adb backup -f FullBackup.ab -apk -all
This will create a “package” called “FullBackup.ab” on the current location in your command prompt. This is your backup package.
Now you can root your phone.
Once finished rooting, insert the “FullBackup.ab” package on your sdcard
Hit the menu button and look for “Extract from ADB backup” option. This will prompt you to search for the file. Use the file manager that you installed earlier and navigate to the directory and select the FullBackup.ab file.
Now restore like as if the backup was made with Titanium Backup. Don’t forget to make a fresh copy of the backup using Titanium Backup. You’re Done!
Click to expand...
Click to collapse

Related

how to store all sms in sdcard and recover later?

Is there a way to store all sms in sdcard and recover them after you have wiped your phone? I know there are some apps but they are so slow. In nandroid it backs up the whole system in like 30 seconds. But I cant use nandroid because I want to use a new rom.
Aside from apps like my backup pro from the market, you can do it through terminal. If you know how to create scripts or use GScript, its even simpler. What you can do is backup the mms/sms app database, then restore it after you flash the new rom.
Note: this method may not always work and you may need to reboot before it shows up in your app so keep that in mind.
In summary with the first step, you're backing up the database to your sdcard, and in the second you're restoring it to phone memory (after a new rom)
TO BACKUP:
Go into terminal and type:
Code:
su
busybox cp /data/data/com.android.providers.telephony/databases/mmssms.db /sdcard/mmssms.db
TO RESTORE: - once you flash a different rom, or wipe
Go into terminal and type:
Code:
su
busybox cp /sdcard/mmssms.db /data/data/com.android.providers.telephony/databases/mmssms.db
Then reboot.
Hope that helps.

[Q] How to properly make a total backup of your current ROM

I have a very decent working ROM at the moment (4.4.4 rooted xposed gravitybox etc.) and I'm not sure I can live with Lollipop without al those tweaks. So before upgrading to Lollipop (whenever that may be), I want to make a decent backup of my current ROM.
Normally I would do this with TWRP, but the backup doesn't seem to work at the moment. And there doesn't seem to be a properly working version of TWRP.
So how do I make a proper backup of my ROM?
Adb?
A confirmed working version of TWRP?
CWM?
Another?
Jeltel said:
I have a very decent working ROM at the moment (4.4.4 rooted xposed gravitybox etc.) and I'm not sure I can live with Lollipop without al those tweaks. So before upgrading to Lollipop (whenever that may be), I want to make a decent backup of my current ROM.
Normally I would do this with TWRP, but the backup doesn't seem to work at the moment. And there doesn't seem to be a properly working version of TWRP.
So how do I make a proper backup of my ROM?
Adb?
A confirmed working version of TWRP?
CWM?
Another?
Click to expand...
Click to collapse
You can use standard tools installed on the phone to dump your partitions. See here for a rundown. I'd recommend backing up /boot, /recovery, /system, /pds, /modem and /fsg.
Ah yes, that's what I was looking for. Thanks
When I restore the mentioned items, will I get back my old installation? Or should I backup more? i.e. userdata for example?
And how to restore all these items? (I know to flash the boot, recovery and system.img via adb).
Yeah, you'd need to backup the data partition too, if you want to keep settings and user data. Remember, dd produces a 1:1 copy of the partition... I prefer to backup personal data selectively. The quick way to do it is by using a backup app: Most use Titanium Backup, but I find Chainfire's Helium does the job well, too. The other way is to use the built-in 'backup' command directly to select a range of files to save (i.e. 'adb backup')...
The partition images can be restored from adb using the reverse version of the command you used to make to the backup, i.e. use dd but with the 'if' and 'of' parameters switched:
Code:
dd if=/path/to/source.img of=/path/to/block/device
Be careful though; if you write the wrong image to the wrong partition, you can damage -- or even hose -- your software environment.
In the case of most partitions, restoring images should be done whilst booted into recovery for safety reasons, rather than overwriting a filesystem whilst it is mounted and in use. If you have the stock recovery installed, you can temporarily boot into TWRP or CWM recovery from a recovery image stored on your computer (i.e. 'adb boot /path/to/recovery.img') and then enable adb from within the custom recovery environment. Then you just use 'adb shell', followed by the 'su' command to switch to the root user account.
For the same reason, you should write the recovery partition backup back to disk from adb within the normal android environment. Again, you must do this after switching to the root user account by issuing the 'su' comand.
Alternatively, you should be able to write all the images from fastboot mode (i.e. 'adb reboot lootloader'). For example:
Code:
adb fastboot flash recovery recovery.img
AFAIK, fastboot will accept standard images created with dd, but I have never tried it on a Moto G, so YMMV... Maybe someone else would care to comment on this?

[SOLVED] 'adb backup' gives blank output

I'm trying to do a backup using this adb command:
Code:
adb backup -apk -noshared -all -nosystem
I need to make an adb backup so that I can restore the backup on a non-rooted phone.
However, when I enter the command, the cmd window only gives an output saying "Now unlock your device and confirm the backup operation", and then ends immediately, leaving a blank (0 kb) backup file.
I then checked the logcat and saw an error message saying "unable to launch full backup confirmation".
I've tried rebooting and still, no luck.
Does anyone know why the backup confirmation screen just wouldn't show up on the phone? I really need to backup my apps and restore them on a non-rooted device so adb backup is my only option.
The rom I'm using is Candy5 ( https://forum.xda-developers.com/xpe...andy5-t3196185 )
Solved by myself.
It turns out the rom doesn't have the package 'com.android.backupconfirm' installed. So what I did was doing a twrp backup first, flashed the last snapshot version of CM 12.1, used 'adb pull' to pull 'BackupRestoreConfirmation.apk' from '/system/priv-app/BackupRestoreConfirmation', restored the backup, copied the apk to the same directory and rebooted. The backup confirmation screen finally shows up and I can do backups now.

th ADB Files Backup restore without success

Hi Guys.
Excuse my english
I have with ADB and the command
adb backup -all -apk -shared -f d: \ backup.ab
created a backup of my phone. According to the phone in the end, this backup was also made.
I also find under the drive D made the backup.
Then I had to reset the same phone to factory settings.
So again I have with ADB and the command.
adb restore d: \ backup.ab
The recovery started.
This can be tracked on the phone also, you can see how he restores the backup.
At the end, the message "Backup successfully recovered" appears on the phone.
But there is no change on the phone.
What am I doing wrong?
Or what can I do? In order not to have to do everything again from scratch.
Thank you for your help.

[GUIDE] Backup EFS Partition Without A Decryptable TWRP [No Root Required]

As there is no decryptable TWRP, it isn't as easy as before to bakcup the EFS partition. But doing it via Terminal isn't too difficult. I didn't find a good tutorial that isn't burried somewhere on the internet. And none for the 7T Pro (though the commands and partitions are the same on older OnePlus devices.
If you already know how to boot TWRP or you already have it, go to the second instructions list and skip the first one.
I am not responsible if anything goes wrong. You do this at your own risk!
Requirements:
- An unlocked bootloader
- Working adb and fastboot (e.g. Google's Platform Tools)
- Download a bootable TWRP
Instructions to boot TWRP:
- Connect your device via USB
- Go to Settings > Developer Settings > Enable Advanced Reboot Menu
- Hold down the power button and select "Bootloader"
- In the bootloader use (It won't modify anything, you simply boot into TWRP once and after a reboot it's "gone".)
Code:
fastboot boot NameOfTWRPImage.img
Instructions to backup EFS:
If TWRP has booted, type the following into your computers' terminal one after the other:
Code:
adb shell
dd if=/dev/block/sdf2 of=/tmp/modemst1.bin bs=2048
dd if=/dev/block/sdf3 of=/tmp/modemst2.bin bs=2048
exit
adb pull /tmp/modemst1.bin modemst1.bin
adb pull /tmp/modemst2.bin modemst2.bin
This will copy modemst files to the temporary folder on the phone (which can be accessed though the data is lost after a reboot) and "adb pull" copies them from the device to the user's profile folder on Windows or Mac. You have successfully backed up the EFS partition!
Please note that this could be performed with root permissions on a booted device. Though I always prefer backing up files with a non-booted system. Also this guide will work if you're not rooted.
Is it possible to backup all system and data so we dont have to setup everything in the device after a factory reset? I mean, that backup we all were used to in TWRP.
Best regards
lucfig said:
Is it possible to backup all system and data so we dont have to setup everything in the device after a factory reset? I mean, that backup we all were used to in TWRP.
Best regards
Click to expand...
Click to collapse
Unfortunately not. Backing up EFS doesn't require decryption as it's not stored on /data. Everything on /data can't be backed up afaik.
Also /vendor and /system can't be mounted as of now making a Nandroid backup impossible.
Macusercom said:
Unfortunately not. Backing up EFS doesn't require decryption as it's not stored on /data. Everything on /data can't be backed up afaik.
Also /vendor and /system can't be mounted as of now making a Nandroid backup impossible.
Click to expand...
Click to collapse
Thanks.
That is a shame. At least titanium backup still working great.
Enviado de meu HD1903 usando o Tapatalk
Macusercom, thank you for the guide!
Now how do we restore them? With the opposite dd command?
Or we can just flash them directly via fastboot?
Also, what is the full list of partitions which contain data unique to this specific device?
I mean all these EFS, persist, IMEI, screen/touch calibration data, all sensors factory calibration data, fingerprints, etc.
Is it only EFS + persist or there are more of them?

Categories

Resources