Now that the modified ROMS (fantastic!) are coming to the Hero, sometimes a wipe willl be mandatory. Especially when you switch chefs.
That's a pity when you spent hours downloading apps and setting your device up.
I know of backup programs like backup for root and mybackup but they don't bring your phone back in the same state as before the backup.
Nadroid restores the whole phone including the ROM.
So isn't there a universal way (or a program) to backup all but the ROM and restore the settings and apps after a full wipe.
So I hope someone can find a way to backup and restore the settings.
Or maybe better, to prevent a wipe whatever ROM-upgrade you do.
Please help us save a lot of time and effort.
arene said:
Now that the modified ROMS (fantastic!) are coming to the Hero, sometimes a wipe willl be mandatory. Especially when you switch chefs.
That's a pity when you spent hours downloading apps and setting your device up.
I know of backup programs like backup for root and mybackup but they don't bring your phone back in the same state as before the backup.
Nadroid restores the whole phone including the ROM.
So isn't there a universal way (or a program) to backup all but the ROM and restore the settings and apps after a full wipe.
So I hope someone can find a way to backup and restore the settings.
Or maybe better, to prevent a wipe whatever ROM-upgrade you do.
Please help us save a lot of time and effort.
Click to expand...
Click to collapse
By backup, I'm assuming you mean all your personalized settings (accounts signed in, placement of icons on home screens, etc) and your apps, right?
You should be able to do (with your phone connected, assuming you're on windows);
Code:
adb remount
adb shell
#mkdir /sdcard/databk
#cp -r /data/* /sdcard/databk
This backs up all your data folder, but you don't want to keep everything or it might cause problems (though Hero builds don't vary so much amongst them where it would be a problem, most (2.83xx is the notable exception) are odexed, so they don't write much to dalvik-cache, and even if you change framework version, dalvik does a version check and if they're different, it'll replace those caches with new dex dumps.), you really only want to keep the folders app, app-private, data, misc, and property. If you want, you can also go inside the data folder and erase the apps whose settings you don't want backed up (you have to know what you're doing, though worst care scenario, you'll just lose the settings for that app).
After you're finished flashing your rom (clean install, yay), just go again:
Code:
adb remount
adb shell
#cp -r /sdcard/databk/* /data
after it's done, you might want to reboot, but I don't know if it's really necessary, just to be safe.
That should do it... I hope cyanogen works a sort of "backup settings only" into his next recovery image.
Just wipe everything in data except for the apps :
Code:
adb shell
#find /data ! \( -path "/data/app-private/*" -o -path "/data/app/*" \) -delete
Easy...
Related
I would be much more willing to try more ROMS and provide feedback if restoring wasn't such a pain in the ass. Currently I have 114 apps that get restored which means having to agree to the permissions for each one. This is time consuming and monotonous. Is there an option to restore the apps and data automatically without having to agree to the permissions for each app?
Get the donate version.
I don't always complain, but when I do, I #BlameWes
Seriously? If that's a feature I get in the donate version I will go do that right now.
Arrrgghhh....
Paid for it
Market says "Purchased"
Each attempt to install it just results in "Download Unsuccessful"
It might be cause of the 2.2 market, reboot your phone and try again.
I don't always complain, but when I do, I #BlameWes
Remember you get the key for the donate version via email and you need to put it in your SD root. Then the version you already have will become the donate version. The features you are looking for when you have it working are in the 'batch' section. Also, making a flashable .zip out of titanium makes restoring after flashing a piece of cheese. I can flash a ROM and have my whole system up and running with everything restored, including ADW settings and desktop widgets in a matter of minutes.
Worth every penny.
p.s. always remember to make a nandroid backup as well just incase.
Finally got an email from google checkout, just had to update my credit card info. I am now running Pro. I have got to do the flash update feature, that will make life so much easier.
so would it be recommended to flash the rom first and, once that's up and running ok, then flash the titanium zip?
i finally got up the nerve to flash bionix 1.8 today and spent a lot of time individually restoring each app... i'll gladly get the donate version to speed some of that up.
also, what do people do in terms of system settings? i didn't want to restore those in case old settings may interfere with new ones. i guess it requires fully researching what's in the rom in the first place, but is there a rule of thumb most of you go by?
it also looks like there are 2 options for creating zips: one for user apps and one for system apps. do you make one of each or do you simply go with the "user" version and rely on the rom's system apps? the latter makes sense to me, otherwise, why flash the rom? thought i'd ask though.
thanks all!
Just use the Settings Menu > Batch > Restore missing apps with data
It should allow you to pick what you want and wham.......
I've tried to build a update.zip file, but I guess with 70+ apps it never seemed to work for me.
kizer said:
Just use the Settings Menu > Batch > Restore missing apps with data
It should allow you to pick what you want and wham.......
I've tried to build a update.zip file, but I guess with 70+ apps it never seemed to work for me.
Click to expand...
Click to collapse
thanks. so you don't restore system data?
If any of you are willing to write a guide I would love to add this to the sticky!
hope someone takes you up on that...
^ I actually decided to buy the full version, it is so good that I may just write it myself. Not often is a paid version a LOT better IMO... But the donate version of TB is nothing short if amazing. So much faster and easier.
Titanium Backup Documentation
Found some nice documentation for Noob's. Quick google
Titanium Backup is ONLY available through these sources:
1. LegenDroid Community (our forum)
2. Titanium Backup's site
3. Modaco's Custom ROM
4. Android Marketplace
Tips & Suggestions:
* When you start Titanium Backup on a new ROM, if you have any doubt about your busybox version, it is highly recommended that you click the "Problems?" button before doing any backup or restore !
* Don't forget to verify your backups (Click MENU - Batch) to ensure that your backups are OK.
* You need to reboot after restoring system items (eg: Contacts, SMS, Settings, etc) for the changes to take effect. If you backup/restore across very different ROMs, I advise to be cautious and only include the system items you really need to preserve.
* You can easily create a custom apps list by creating a Label in Apps Organizer, then going back to Titanium Backup, clicking "MENU" and then "Filters" and finally, selecting the Label you want. Your apps list will then be filtered just the way you want
* If you backup the same app several times, Titanium Backup will save SD card space by storing each apk version only once.
* After restoring your apps, you can run the Market Doctor to verify their Market links. If Market Doctor reports everything as okay, yet your apps are still not listed in "My Downloads", try to search for them in the Market. If they show as "Installed", it confirms that the links are okay, but your Market needs a refresh: just install any app from the Market, and the "My Downloads" section will be refreshed !
* If you want to remove a system app, first you can try to freeze it and see if everything still works fine. Once you've gained more confidence that you don't need it, just go ahead and un-install that system app.
First Backup
* Verify that Titanium Backup has started without warning and that your busybox is OK
* Click the Backup/Restore tab
* Click Menu (the button), Batch
* Click "Backup all user apps"
* Let it run, then go back
* Individually backup the system data you want. That is most green-colored items. This will be bookmarks, call log, calendar, launcher, WiFi, etc.
* Now your backups are in the "TitaniumBackup" directory on your SD card.
Restoring your backups
* Download Titanium Backup from Market
* Click the Backup/Restore tab
* Click Menu (the button), Batch
* Click "Restore all missing apps + system data
* Reboot your phone
* It's done ! The only thing you may have to adjust is usually your wallpaper/widgets.
FAQ
1. What can it back up ?
* All the applications you have installed, included protected ones
* All the data and settings of these applications,
* Most (or all) of your phone's settings and data.
* NOTE: It will not backup the system applications from your ROM. Only their settings will be backed up.
2. How do I restore my apps without having to do them one at a time ?
* Hit MENU (button on the phone) then "Batch",
* Scroll to the restore scenario you want to run,
* Hit the "RUN" button.
* NOTE: The applications will install in sequence, but will require user interaction (in the Free version). The Donate version will do unattended, background restores.
3. Can it back up SMS, MMS and system settings ?
* YES. The most useful "system items" are green-colored and have a prefix such as [SMS/MMS/APN] in the list.
* Other system items (that are usually less useful to backup) are red-colored.
* Please note that if you backup and restore all system settings across very different ROMs, you are on your own.
4. Can it back up and restore applications across different ROMs or even different phones ?
* YES, without restrictions.
5. Are older backups compatible with newer Titanium Backup versions ?
* YES. The backups are in 100% standard unix formats and can also be unpacked on Linux machines.
6. Where are my backups stored ?
* In the TitaniumBackup folder on your SD card.
7. Does "freezing" apps free space from phone memory ?
* No, it doesn't. The "frozen" app remains on the phone with its data, it's just that the app gets completely disabled until you "defrost" it.
8. Why is the "Restore" button disabled for some system apps ?
* System apps are part of your ROM, so Titanium Backup will only backup their data (not the apps themselves). For this reason, if you backup a system app, and then switch to a ROM where that app is missing, Titanium Backup obviously cannot restore the data for it.
Troubleshooting
First step: The "Problems?" button alone should resolve about 90% of problems !
If you have a "bad" backup for an app / "Parse error" on restore (will *not* happen if you have a good busybox version from the start):
* When you backup an app, the "old" backed up APK is reused in the new backup (if the app version did not change).
* For this reason: If you have a bad APK in a backup, you need to delete all backup(s) for that app.
* To keep your data: reinstall that app from Market, restore data-only with Titanium Backup, then delete all backups for it.
* On the next backup, the APK will be created again, and your backup will be (and remain) good.
If the "Problems?" button fails to work, you can still do it manually:
* Download busybox and unzip it if its zipped
* Copy the "busybox" file to the root directory of your phone's SD card.
* Remount the SD card in the phone.
* Open a shell on the phone (using either "adb shell" or the free "ConnectBot" app) and do:
Code: [Select]
su
cd /data/data/com.keramidas.TitaniumBackup/files
cat /sdcard/busybox > busybox
chmod 755 busybox
rm /sdcard/busybox
* Exit the shell and restart Titanium Backup. If it says "busybox 1.15.3 from app" then it's a success !
Check if your phone is properly rooted:
* Open a shell on the phone and do:
Code: [Select]
su
whoamiYou must see "root" or "whoami: unknown uid 0". If you see something different, your phone is not properly rooted.
If its rooted, type the following code:
Code: [Select]
busybox ls -l /data/data/ | busybox wc -l (for testing your system's busybox)
cd /data/data/com.keramidas.TitaniumBackup/files/ ; ./busybox ls -l /data/data/ | ./busybox wc -l (for testing Titanium Backup's busybox)
You must see a number. If you get "Permission denied", your phone is not properly rooted.
Sources taken from Titanium Backup's official site for reference
I'm on my Nexus 7 Tablet and unfortunately I have to do a factory reset yet again due to the issues presented in this thread: http://forum.xda-developers.com/showthread.php?p=32943570#post32943570
My Question is if I'm doing a factory reset is it safe to "copy/paste" the /data folder from now to after the reset to preserve my apps and settings? I hate having to download them all again and set everything up from scratch but I want to make sure it's safe. Even if I have to go through it and delete some of the files to make it safe it's better than spending 4 hours setting things up every time it craps out.
I would make a backup.ab with adb backup for the system or a titanium backup for each app but unfortunately I can't get into the apps since it won't boot up. Clockworkmod has an adb interface so that's how I plan to pull and push the /data folder but unfortunately it doesn't have an interface for adb backup.
As my other thread outlines I am on stock everything except for SuperUser su and Clockworkmod recovery.
Any ideas or help would be appreciated. Thank you very much for any assistance.
One reason why I chose to buy this device (aside from official Google support) is the overwhelmingly large amount of developer enthusiasm for it. And with that enthusiasm comes a lot of custom ROMs.
I haven't had time to test all of them, but I will - and here's a guide I made that'll hopefully make testing different ROMs easier.
Prerequisites
Before continuing with this guide, make sure that you have:
a LOT of free time, depending on how many ROMs you want to test;
unlocked and rooted your device;
downloaded all the ROMs you want to test;
have installed a good recovery - I would recommend the latest version of TWRP;
common sense.
(OPTIONAL) a spare microSD card of at least 8GB. This'll make everything easier, as you won't have to delete stuff in order to fit all your ZIPs and backups.
Things to remember
Make sure you know how exactly to restore your device to how it was before following this guide.
You should know what you're doing. One small mistake can lead to your device being completely unusable!
You should know what features you're looking for in a ROM. It's never nice to have gone all the way to flash a different ROM, only to discover that feature X doesn't work. Ask questions in the ROM thread, if you like.
You can always ask help from others, should you have any trouble with your device.
When using custom ROMs (or any customization, for that matter), do NOT ask for ETAs. Our developers are doing their work at their own leisure and during their own time, and they don't get their pay from you.
Ready? Let's get going!
Getting started
A good Android user always backs up before doing anything radical to their phone, and that's precisely what we're going to do. There are three ways to go about this:
The easy way
The easy way is through making a Nandroid backup. This is particularly easy to do in TWRP, as all you need to do is reboot into recovery, press Backup, select the partitions you want to back up and whether to compress them, and start backing up. Simple as that.
Pros: Easy to restore your data once you're finished testing ROMs.
Cons: It's somewhat hard to restore individual pieces of data (such as messages and apps) instead of the whole thing.
The (slightly) more complicated way
This way deals with TitaniumBackup, an absolute must-have app for every Android user out there.
With TitaniumBackup, you can choose to back up individual apps (and even update their individual backups). TB isn't limited to backing up/restoring data, though; it can do so much more - remove bloatware, freeze apps you don't use, make a flashable ZIP out of your backups... the list goes on.
Pros: Finer control over what data gets backed up. Very powerful tool in migrating ROMs.
Cons: Somewhat outdated and intimidating interface; and features are reduced without buying the PRO version.
The Google way
This one is the simplest way of all three, though it only works if you have a) GApps and have signed in to your Google account, b) if you've agreed to let Google back your data up when you first set up your device, and c) if you have Settings > Backup & reset > Back up my data enabled.
Google automatically backs up almost all of your data to its servers, ready to be restored when you do a factory reset/switch to a new phone. A list of all data that are backed up can be seen by going to Settings > Accounts > Google > (your email address).
Notable exceptions to the data backed up are messages, which you have to back up yourself - I recommend SMS Backup & Restore for that.
Now that you have your data backed up, let's get flashing.
Flashing
Put your ROMs/kernels/GApps on your SD card, then reboot to recovery.
1. Wiping / factory resetting
This is why we back up your data in the first place. Different ROMs need different data, and data left over from one ROM can cause another ROM to get stuck in a bootloop.
Tip: If you're using TWRP, try enabling Use rm -rf instead of formatting in Advanced settings. Formatting doesn't really have any perceivable advantages over simply removing the contents of your data partition (unless you somehow corrupted it), and it actually causes higher wear on your storage chip. (Storage doesn't last forever - I've had my old Samsung bricked because I reformatted too much.)
Click to expand...
Click to collapse
In CWM, it's called wipe data/factory reset; in TWRP, it's simply called Wipe. Wipe your data, dalvik-cache, and cache partitions.
2. Flashing the ROM and other addons
In CWM, it's called install zip (from sdcard); in TWRP, it's simply called Install. Browse to your ROM zip and install.
Tip: If you're using TWRP, you can add ZIPs to the ZIP queue in this order: ROM > GApps (if any) > Kernel (if any) > Addons/Patches (if any).
Users of CWM must manually flash each ZIP, in the same order.
Click to expand...
Click to collapse
3. Finishing up
Now all that's left to do is pray for the best and reboot.
Testing
If you flashed GApps, do NOT let Google restore data yet. We'll do that later.
Click to expand...
Click to collapse
After initial setup completes and your newly-installed ROM settles down, it's time to get testing. It would be helpful if you listed down all the features you need and check/cross them out one by one if they work or not. For example, I need working screen cast and usable video recording, both of which do not work in all the CM-based ROMs I've tested.
Some ROMs, especially sprout4 ROMs, require patches when installing on sprout8 devices in order to provide the most optimal experience. Try flashing those to see if the ROM gets any better for you.
Rinse & repeat?
So, have you decided that this ROM is for you?
Yes, this ROM is awesome! I love it!
If you backed up earlier using Google, do another factory reset and this time, let Google restore your data.
If you used Titanium for backup, you can safely restore your data now.
If you made a Nandroid backup, you technically can restore your backup as-is since most of the ROMs available for sprout are CM-based; but I wouldn't recommend this as this can cause bootloops. Otherwise, you can manually restore your data one-by-one - but this is a time-consuming process.
I'm not quite sure I like this ROM yet.
Well that's okay, just repeat this guide from the start.
Finishing up
Now that you've decided on what ROM to use, you can safely delete your backups and ZIPs - though it would be better to keep them as they might come in handy if your device starts having problems.
Notes
If you're flashing a Marshmallow ROM, don't flash Xposed right after you flash your ROM as this may cause a bootloop.
Never ask for ETAs on ROM threads. That's rude.
That's it for this guide! Happy flashing! :fingers-crossed:
Reserved 1
Reserved 2
Reserved 3
Awesome post. Enjoyed it!?
aureljared said:
Reserved 3
Click to expand...
Click to collapse
Sry for digging up this old thread. I was wondering if there is a tutorial for Titanium Backup specifically targeting a switch between custom roms, having different versions of android.
I'm in the midth of moving from cm 13 to lineageos 15 and just tried to backup apps+data in Titanium Backup and restore them and the new system is now somewhat buggy..I'm not sure if the restored backup is the reason for this or not....Maybe there are specific settings to be set..... I mean it's common sense for me not to backup and restore system data but maybe I am missing other important things to be set prior to a backup in Titanium Backup.
trohn_javolta said:
Sry for digging up this old thread. I was wondering if there is a tutorial for Titanium Backup specifically targeting a switch between custom roms, having different versions of android.
I'm in the midth of moving from cm 13 to lineageos 15 and just tried to backup apps+data in Titanium Backup and restore them and the new system is now somewhat buggy..I'm not sure if the restored backup is the reason for this or not....Maybe there are specific settings to be set..... I mean it's common sense for me not to backup and restore system data but maybe I am missing other important things to be set prior to a backup in Titanium Backup.
Click to expand...
Click to collapse
It's hard to say, some apps might work improperly or refuse to terminate in the background due to a mismatch in the restored data. I only backup/restore game data nowadays, as Google Backup takes care of my contacts, SMS, settings, and customization. No problems encountered so far.
The only setting I change in TiBkp is the compression method, as the default (gzip, I think) produces somewhat large backups. I use bzip2.
If you really need to restore everything, it might help for you to wipe /data and restore apps in TiBkp one by one until you find the culprit.
aureljared said:
It's hard to say, some apps might work improperly or refuse to terminate in the background due to a mismatch in the restored data. I only backup/restore game data nowadays, as Google Backup takes care of my contacts, SMS, settings, and customization. No problems encountered so far.
The only setting I change in TiBkp is the compression method, as the default (gzip, I think) produces somewhat large backups. I use bzip2.
If you really need to restore everything, it might help for you to wipe /data and restore apps in TiBkp one by one until you find the culprit.
Click to expand...
Click to collapse
Trying the Google Way was also my thought, unfortunately it does not work for me. I posted this today in the rom I used until now:
https://forum.xda-developers.com/showthread.php?p=76022005#post76022005
The initial setup was quite some time ago and now I cannot recall what I may have done to insult the google sync service
Thanks for this.
Can I ask something?
If I'm on stock rom and have magisk and modules installed. To switch rom, do I need to uninstall those first?
or when using nandroid backup... is its okey to backup with magisk+module on it?
watatara.102 said:
Can I ask something?
If I'm on stock rom and have magisk and modules installed. To switch rom, do I need to uninstall those first?
or when using nandroid backup... is its okey to backup with magisk+module on it?
Click to expand...
Click to collapse
You might want to uninstall your modules first to be safe, but if you're sure they're compatible with the ROM you're switching to, then you might be fine keeping them. As always, backup before trying anything dangerous. :good:
Nandroids are whole-device backups, so if you backup while Magisk is installed, Magisk and your modules will still be there when you restore the backup. If that's what you're aiming for, then go ahead and backup. Just make sure to backup the boot image too, since that's where Magisk is installed.
Sent from my starlte using XDA Labs
Can I install a nandroid backup of a totally different ROM to replace the current ROM I'm using with TWRP?
My phone ran into problems after I upgraded Magisk (I was on Canary build). No problem I figured, I will just restore from my TWRP backup.
... only issue was, I have never restored from a TWRP backup. And it turned out to be not as straightforward as I thought. I ended up learning a lot about the process to be able to successfully backup AND RESTORE. So I thought I might write something here to make it easier for you to do this, so you don't have to learn it the hard way like I did.
First I think most of us know data storage is not backed up by default. The partitions selected by TWRP for you (i.e. system, data, vendor, and boot) are sufficient to save an image of your OS plus the installed apps, but not app data (specifically /data/media and everything underneath, so actually this is dependent on how each app stores its data, some or all of an app's data may be stored in /data/data and not /data/media. /data/data IS backed up by TWRP.), and the excluded portion contains your own personal data as well, i.e. the internal storage.
Simply put, if you want a so-called 'full backup', or a complete snapshot of your phone, you will want to do something more than simply a TWRP backup. See below.
Another thing to note is that the location you are backing up to (and I recommend external storage like a USB-OTG device) may *not* have enough space. And while backing up you may not even realize that you have run out of space (as there is no warning particularly with the tar command which I will detail below) therefore your backup may become corrupt ! Take extra precaution to validate the integrity of your backup, and make sure there is always enough space to create the backup. TWRP *does* warn you about lack of space though.
Last but not least, if you have a password (either pattern or numeric) to lock your device, after restoring it is gone. So first thing after restore is to go into settings to setup the password once again. Interestingly the fingerprint data is still there. Once you set up a password the fingerprints will reattach to it. For the apps that have fingerprint login registered, you will need to re-register as the app thinks you have updated your password/fingerprint.
If you don't set up your password after restoring, in TWRP it will just go straight into the main menu as if no password has been set, so basically anyone who knows how TWRP works will be able to access your data if they get a hold of your phone.
Oh one more thing. The format of the backup media (e.g. usb-otg) has to be ex-FAT. Very important. I got badly burned because I had FAT32. And like I said the backup process did NOT warn me at all that this could be a potential issue. Not the tar command anyway.
OK here is the HOW on BACKing UP:
Backup using TWRP should be easy enough. It is documented just above everywhere (restoring is another story however). Just make sure you mount your USB-OTG before starting your backup, and pick USB-OTG as your destination. Let TWRP choose the partitions to be backed up.
This will create a TWRP folder with subfolders, one of which containing the actual backup files.
On to your personal data - in TWRP (while your USB is still mounted), go to Advanced, Terminal, then issue this command: "tar -cpvzf /usb_otg/data_media_backup.tar.gz /data/media"
This will create a .tar.gz file. This is your own data (and like I said some apps write to this space too so it is also app backup).
Validate the integrity of the .tar.gz file with this command: "tar -tf /usb_otg/data_media_backup.tar.gz". If you see no error message then you are good.
Unmount your usb finger, and take it out before leaving TWRP. Otherwise the usb finger may need repairing when you access it in say Windows. And that's always a scary thing.
If you need to archive the backup somewhere in your PC etc, copy 2 things from your USB: The TWRP folder, or at least the subfolder that contains your TWRP backup files (copy the entire folder, or better yet the entire folder structure); and the .tar.gz file. This forms your complete backup image.
Here is the HOW on RESTORING:
Flash MIUI (or whatever your OS is), with matching version as the one in your backup image. i.e. you have a vanilla enviroment that is the same version as the one in your backup.
If for some reason you can't boot into your system afterwards, go into recovery (can be built in recovery, not necessarily TWRP), then wipe your DATA partition clean. Now you should be able to boot.
Boot up the vanilla system. When the first spalsh screen is shown ("welcome to the OS, let's start setting things up", or something like that) just long press the power button to shutdown or restart your phone. Then go into bootloader (lower volume + power buttons for my phone).
Install TWRP, reboot to recovery / TWRP, then do your TWRP restore. Don't forget to mount your otg-usb first ! if the folder structure is there in your usb, or even if you just have that one folder with the backup files underneath, the restore function will show that folder for you to pick. Just pick it then proceed with the restore.
in TWRP (while your USB is still mounted), go to Advanced, Terminal, then issue this command: "rm -r /data/media/0/*" (this is why step 3 was necessary)
if there are other folders underneath /data/media, repeat the rm command once for each of these folders
"cd /"
"tar -xvzf /usb_otg/data_media_backup.tar.gz" <-- this will restore your data !!
Reboot. Voala you have your backed-up system in action once again. Nothing in your phone is different than before the backup, except for the pattern password which is now gone. And you better set it up again right away.
Hope this helps !!
Hi! So, I have a newer Android 10 device with no TWRP support. I think my question is not model specific, so I'm posting generally, but if it matters, it's a OnePlus 7T Pro, bootloader unlocked of course.
Anyway, since there's no good custom recoveries for Android Q (none that I know of that can decrypt /data), I was trying to be safe and using a hacked (adb enabled) stock recovery to make backups from the command line. I have a nice tarball created in recovery mode with "tar cvf - /data/". It looks like it was made properly, I can unpack the files on back onto the device in recovery mode, and it's not corrupt or anything.
The problem is that naively trying to restore it back to my /data partition (e.g. tar xvf) after a wipe causes two problems:
1) after rebooting to recovery, the /data partition just looks encrypted again. If it was working properly, stock recovery can decrypt /data
2) normal system boot just bootloops.
If anyone has tried manually saving and restoring /data from a tarball, I'd appreciate any tips on getting it to work.
My best guess is that the ext4 encryption keys are the culprit - since after a factory reset the device creates new encryption keys, I think I need to figure out how to restore 99% of my backup without overwriting the fresh encryption keys that were created after wiping. I think I need to combine the new encryption keys with the other files in my tarball backup. If I can get past that, I might have to worry about things like SELinux xattrs as well, but one thing at a time.
If any experienced Android hackers know how filesystem encryption works in Android 10, I would appreciate a map of which files should not be overwritten. For example, I'm thinking I should probably avoid restoring some of these files:
Code:
/data/unencrypted/key
/data/unencrypted/key/encrypted_key
/data/unencrypted/key/keymaster_key_blob
/data/misc/vold/user_keys
/data/misc/vold/user_keys/de/0/keymaster_key_blob
/data/misc/vold/user_keys/de/0/encrypted_key
/data/misc/vold/user_keys/ce/0/current/keymaster_key_blob
/data/misc/vold/user_keys/ce/0/current/encrypted_key
/data/misc/systemkeys
/data/misc/keystore
/data/misc/keychain
/data/system/recoverablekeystore.db
[edit] spoke too soon
I ended up doing something janky and wrote a little shell script to repack the files from /data/data and /data/app into files that Titanium Backup could understand. I also figured out how to restore my SMS messages from /data/user_de. That was enough to recover the things I cared most about.
Still begs the question of what's the best method of doing backup and restores of /data on Android 10 when you don't have custom recovery but you do have Magisk, root, and stock recovery with adb. I want to keep hacking and playing with this phone so gotta figure something out.
I like Titanium Backup, have used it for many years, but the maintainance hasn't really kept up with Android development, theres a lot of gotchas like it hangs trying to restore multi APK packages. I still want to figure out something more seamless like a nandroid backup solution even if its from the command line. At least until TWRP eventually supports Android 10.
try backing up data partition in a external storage live usb or sd card
DrWowe said:
I ended up doing something janky and wrote a little shell script to repack the files from /data/data and /data/app into files that Titanium Backup could understand. I also figured out how to restore my SMS messages from /data/user_de. That was enough to recover the things I cared most about.
Still begs the question of what's the best method of doing backup and restores of /data on Android 10 when you don't have custom recovery but you do have Magisk, root, and stock recovery with adb. I want to keep hacking and playing with this phone so gotta figure something out.
I like Titanium Backup, have used it for many years, but the maintainance hasn't really kept up with Android development, theres a lot of gotchas like it hangs trying to restore multi APK packages. I still want to figure out something more seamless like a nandroid backup solution even if its from the command line. At least until TWRP eventually supports Android 10.
Click to expand...
Click to collapse
try backing up data partition in a external storage live usb or sd card, first you for encryption, then restore from external source after formatting phone storage