How to do a COMPLETE TWRP backup / restore to duplicate a system 1:1? - General Questions and Answers

Hi all,
I may be just too wrong-headed at the moment to find out the correct process for duplicating the entire system of a Huawei P9 to another Huawei P9.
(both are identical models and both have Android 7.0 installed, so partition layout should also be the same).
I thought, I'd create a complete TWRP Nandroid backup of the main device (TWRP lets me choose Boot, Data, Vendor, System for backup) and restore all that on the other one. Failed: Some apps behave strangely, lost their data and settings. "Google Play services are not available". And I have an extra home screen with some app icons I did not have on the original system. Also, root is missing on the target system. Other effects might be there that I didn't see yet.
Okay, after some investigation I found out that TWRP does not include /data/media in its backups, which could at least explain some of these effects.
So I re-restored the backup and then additionally copied /data/media from the main phone using TWRP's file manager and via USBOTG drive over to the other phone. I checked that the files were there. OK. Reboot, but still, the same effects as before.
Of course, I also moved the microSD card from the main phone to the other one (there, a lot of data is placed, that some apps may use, but a missing card should not even explain one of the above mentioned effects anyway).
Please, could you advise me what I have to do to copy really the entire phone's content 1:1 over to the other phone, so I can continue to use that other phone in place of the first one?
TWRP claims that it makes that possible. But so far, it doesn't seem to me like it does.
But then, maybe I'm just missing something.
Thanks a lot!

Related

[Q] Revolution HD ROM & SuperWipe Prob/Question

So, I have A HUGE problem. Apparently I massively misunderstood how the "superwipe" works, thinking it would erase all my apps, but not my personal files, like the file I had created and named "School", and stored all my papers, notes, and research files in. So, I made my nandroid of stock, and flashed Revolution, expecting that, like on my phones, the backups from MyBackup Pro, and other apps, and my personal files would be left untouched. It seems I was very, very wrong. Now I'm regretting not following my gut instinct and manually wiping to maintain those files, as well as not going the extra redundancy of copying them to my removable micro sd as well. Lesson learned. It boggles my mind more than a little that there isn't a clear explanation right on the front page with the rest of the warnings and disclaimers, that the superwipe would kill all your personal data as well as the necessary files to allow the flash.
That aside, and I know this is a long shot, but is there a way to recover that data? I've already flashed back to my stock nandroid, hoping that would somehow restore it, but no dice. Are there any other options here?
Thanks in advance for any help.
It's a long shot and I'm not sure if this will work on flash memory that has been formatted/overwritten, but you can try to connect your TF to your pc as mass storage device and run software such as http://www.jufsoft.com/badcopy/flash_drive_recovery.asp to retrieve this folder and files. Good luck!
To be fair right under the link it does say " This script will erase and format your data, system and cache partition using EXT4 file-system ---
--- Please note that the content of /data/media folder (internal virtual SD card) will be removed - do backup of necessary files! ---"
But yeah I agree, bigger font and capital letters say something like "THIS WILL DELETE EVERYTHING" would be more easier to understand
AFAIK recovery software won't work on it, due to the file system.
Sent from my customized HTC Desire using TTP

Restored nandroid, what's with the sdcard?

Hey guys,
a nandroid backup is a really convenient method to backup your complete phone and restore everything or partially data. All partitions (/system, /data, /cache) were being backed up.
But what happens with the sdcard?
Before I flash/install a new rom, I always format my sdcard with my PC, hence I make sure, that it’s clean and has no remains from older roms.
On first boot, the android system creates a lot of folders contaning data, which both are modified during the daily use. For example the folder “DCIM” contains all the taken pictures and videos.
But what’s about these?
- .android_secure
- .dta
- .estrong
- and especially “Android” and subfolders
What happens, if I make a full nandroid of my phone, format my sdcard, so that all the folders and data, which were created while using the rom, were deleted. After that I restore the complete backup and boot up the phone.
My question is, how the restored system will react, if it notices, that these folders and their contents were not available?
- will they be recreated?
- does the system not boot
- after booting it will show some error messages?
- something else?
Thanks in advance!
@@RON
Hi
Greeting
Nandroid only backups phone memory
It does not backup sdcard
And their is no need to format sd card everytime before flashing Rom (i haven't formated my sd card even once ) every thing works f9
Even if u remove all the file from sdcard which u mentaion then the phone recreate these file againg and causes no problem
Basically a Rom has to do nothing with the sdcard the phone runs completely even without sdcard . Sd card is just an expansion of memory to phones
And you do whatever with it , it does not affect the way your Rom runs
Sent from my HTC Sensation XE with Beats Audio Z715e using xda premium
@@RON said:
Hey guys,
a nandroid backup is a really convenient method to backup your complete phone and restore everything or partially data. All partitions (/system, /data, /cache) were being backed up.
But what happens with the sdcard?
Before I flash/install a new rom, I always format my sdcard with my PC, hence I make sure, that it’s clean and has no remains from older roms.
On first boot, the android system creates a lot of folders contaning data, which both are modified during the daily use. For example the folder “DCIM” contains all the taken pictures and videos.
But what’s about these?
- .android_secure
- .dta
- .estrong
- and especially “Android” and subfolders
What happens, if I make a full nandroid of my phone, format my sdcard, so that all the folders and data, which were created while using the rom, were deleted. After that I restore the complete backup and boot up the phone.
My question is, how the restored system will react, if it notices, that these folders and their contents were not available?
- will they be recreated?
- does the system not boot
- after booting it will show some error messages?
- something else?
Thanks in advance!
@@RON
Click to expand...
Click to collapse
When making a nandroid backup, system, data, boot and cache partitions are saved. Also, the android_secure from the SDcard is saved. As for the other folders, they are not kept. EStrongs is the guys who make ES File Explorer, and I believe this folder has something to do with the app. I don't know about the other folders, but they are not required for running the ROM. If they are missing, they will be recreated.
I believe I answered some of your questions above, but I'll answer the rest here:
-As I said, the restore won't create the folders, but the ROM might create them. At least one of the folders you listed is of an app, and there are many more apps that create folders on your SDCard, that's just cache or some data, which is not a problem to restore.
-The system will boot. That's the idea of a nandroid backup (if those folders were required, they would have been backed up)
-It will not show error messages, it will resume just like when you made the backuo.
-Something Else? You name it. There is no need to format your SDCard every time you flash a ROM, as usually it doesn't create problems. It can get a bit messy, but besides that, it's fine to keep it the way it is.
astar26 said:
When making a nandroid backup, system, data, boot and cache partitions are saved. Also, the android_secure from the SDcard is saved. As for the other folders, they are not kept. EStrongs is the guys who make ES File Explorer, and I believe this folder has something to do with the app. I don't know about the other folders, but they are not required for running the ROM. If they are missing, they will be recreated.
I believe I answered some of your questions above, but I'll answer the rest here:
-As I said, the restore won't create the folders, but the ROM might create them. At least one of the folders you listed is of an app, and there are many more apps that create folders on your SDCard, that's just cache or some data, which is not a problem to restore.
-The system will boot. That's the idea of a nandroid backup (if those folders were required, they would have been backed up)
-It will not show error messages, it will resume just like when you made the backuo.
-Something Else? You name it. There is no need to format your SDCard every time you flash a ROM, as usually it doesn't create problems. It can get a bit messy, but besides that, it's fine to keep it the way it is.
Click to expand...
Click to collapse
Yeah, you're right!
I clicked through the folders on my sdcard and the most directories are named "cache" etc. Only some exceptions for e.g. whatsapp message database or downloaded maps for htc locations ...etc.
So it seems, that the android system and the installed apps create folders for their use. If a nandroid will be created, the last mentioned folder should be backed up, too ... but manually. Thus the first mentioned folders (.data ...) are unnecessary.
You said, that there is no need to format the sdcard everytime a new rom will be flashed. I think it is, because every new rom deserves a clean sdcard, which has no remains from older roms. So the rom can expand themself and have a great feeling
No joke, in my opinion it will be the better way, if there are no possible complications with older existing files.
@@RON said:
Yeah, you're right!
I clicked through the folders on my sdcard and the most directories are named "cache" etc. Only some exceptions for e.g. whatsapp message database or downloaded maps for htc locations ...etc.
So it seems, that the android system and the installed apps create folders for their use. If a nandroid will be created, the last mentioned folder should be backed up, too ... but manually. Thus the first mentioned folders (.data ...) are unnecessary.
You said, that there is no need to format the sdcard everytime a new rom will be flashed. I think it is, because every new rom deserves a clean sdcard, which has no remains from older roms. So the rom can expand themself and have a great feeling
No joke, in my opinion it will be the better way, if there are no possible complications with older existing files.
Click to expand...
Click to collapse
What needs to be cleaned is cleaned when you wipe the phone. Anyway, formatting the SDCard is your choice. Files of apps that are not installed just won't be used. I like your idea of starting fresh, but it's quite a hassle to format and rearrange the SD every time I flash a ROM.
It's nice to have it clean without many directories (Imust say that I managed to reach such a situation with my own documents, with directories I created myself and have no idea what they are for. But I guess that's what you get when you don't clean your "room" for a couple of years.

[Q] Prepare Device for RMA Switch

I'm affected by the Cracked Edges fault with the tablet, and have successfully opened an RMA with NVidia.
I want to be ready to transfer all data over to the new device, but I have a few specific questions that may be better contained in one thread that folks can reference (without having to hunt around XDA)
Question 1 - Apps on SD Card
Like many 16GB tab users, most of the larger apps are on the external memory. I've not owned a device with a "Move to SDCARD" solution baked in before, so my question is:
Can I pop the sdcard out of one tablet and when inserted into the new device, the apps on external storage will sort themselves out and be loaded when the new device boots?
Question 2 - Apps on Local Storage
I'll need to back these up (naturally), but is there a way in TiBu to specify apps on a particular storage target (for example, internal memory or external memory)?
The way I understand it, I'd need to create a backup profile for Games (on external SD) and Apps (on internal SSD) and manage the backups this way.
My thinking is that I'd need to restore the large data apps in a separate restore so I could specify the storage target.
Is that even possible in TiBu?
Otherwise I would run out of room if I tried to flash an update.zip with all the apps back onto the shield's SSD.
Question 3 - TiBu-created update.zip and Stock Recovery
I've stuck with the factory recovery, however I have Towelrooted and use Flashify to do any OTA updates.
If I created an update.zip in TiBu, would I need to also load a custom recovery (CWM) to flash this back to the device? Or would the custom recovery allow me to flash a zip created by TiBu (I've got a feeling I'm outta luck here).
Summary
If the steps I've proposed here sound really cludgy or onerous to any of you, I'd love to get your thoughts about how to restore data with minimal fuss back to the new tablet. Any power tips are welcome, and may help others in the same situation.
Thanks for your help with my question.
jaredmorgs said:
I'm affected by the Cracked Edges fault with the tablet, and have successfully opened an RMA with NVidia.
I want to be ready to transfer all data over to the new device, but I have a few specific questions that may be better contained in one thread that folks can reference (without having to hunt around XDA)
Question 1 - Apps on SD Card
Like many 16GB tab users, most of the larger apps are on the external memory. I've not owned a device with a "Move to SDCARD" solution baked in before, so my question is:
Can I pop the sdcard out of one tablet and when inserted into the new device, the apps on external storage will sort themselves out and be loaded when the new device boots?
Question 2 - Apps on Local Storage
I'll need to back these up (naturally), but is there a way in TiBu to specify apps on a particular storage target (for example, internal memory or external memory)?
The way I understand it, I'd need to create a backup profile for Games (on external SD) and Apps (on internal SSD) and manage the backups this way.
My thinking is that I'd need to restore the large data apps in a separate restore so I could specify the storage target.
Is that even possible in TiBu?
Otherwise I would run out of room if I tried to flash an update.zip with all the apps back onto the shield's SSD.
Question 3 - TiBu-created update.zip and Stock Recovery
I've stuck with the factory recovery, however I have Towelrooted and use Flashify to do any OTA updates.
If I created an update.zip in TiBu, would I need to also load a custom recovery (CWM) to flash this back to the device? Or would the custom recovery allow me to flash a zip created by TiBu (I've got a feeling I'm outta luck here).
Summary
If the steps I've proposed here sound really cludgy or onerous to any of you, I'd love to get your thoughts about how to restore data with minimal fuss back to the new tablet. Any power tips are welcome, and may help others in the same situation.
Thanks for your help with my question.
Click to expand...
Click to collapse
I'd assume that if you're fully stock, a simple factory reset would do the trick after running SuperSU's unroot option. Titanium will backup just fine. I'm assuming your backups are on the microSD. When you restore them, you could make the external storage the default installation location when restoring those apps. But it may not be necessary if those apps were programmed to prefer external memory. Won't be too hard to even manually move them over if you don't happen to have many apps like that.

Help understanding storage partitions

I've always used Samsung devices (last device was GS5) so I'm trying to understand the internal partitions on newer versions of android. I don't mean the dual slot stuff either.. just the normal partitions like /system
So with my GS5 of I went into TWRP and factory reset. That wiped all user data from the phone. Apps, settings, downloads, pics, etc..
It seems that's not how it works anymore. Just looking for a basic layout of the folder structure and what is stored on each partition
Where is my user data stored? Are my downloaded apps, settings, pics, downloads (everything I put on the phone) stored in one partition? If so where
When I factory reset in recovery what partitions is that wiping
At this point the only thing I know is /system which is where the actual OS itself is stored.
Any explanation would be appreciated!!
aholeinthewor1d said:
I've always used Samsung devices (last device was GS5) so I'm trying to understand the internal partitions on newer versions of android. I don't mean the dual slot stuff either.. just the normal partitions like /system
So with my GS5 of I went into TWRP and factory reset. That wiped all user data from the phone. Apps, settings, downloads, pics, etc..
It seems that's not how it works anymore. Just looking for a basic layout of the folder structure and what is stored on each partition
Where is my user data stored? Are my downloaded apps, settings, pics, downloads (everything I put on the phone) stored in one partition? If so where
When I factory reset in recovery what partitions is that wiping
At this point the only thing I know is /system which is where the actual OS itself is stored.
Any explanation would be appreciated!!
Click to expand...
Click to collapse
/data
/data/app
/data/user
/data/media...
You can see all these folders and what they contain via something like Root Explorer. Then install an app or modify its settings, you'll easily see its date/time properties get changed.
Or you can use ES Explorer, every time a new folder gets created, ES notifies you. After a while, it gets annoying but it's good to be able to observe in the beginning.

Full(!) backup via ADB

Is there a way to perform a full backup via ADB?
Like a script or a line which creates a flashable full copy of one or all of the phones filesystems to PC.
Not(!)
adb backup -all
which backups merely system settings and not a migrate app which a) does not perform a full backup as it omits random files and b) works internal and neither TWRP backup-tool which only works internal.
andy01q said:
Is there a way to perform a full backup via ADB?
Like a script or a line which creates a flashable full copy of one or all of the phones filesystems to PC.
Not(!)
adb backup -all
which backups merely system settings and not a migrate app which a) does not perform a full backup as it omits random files and b) works internal and neither TWRP backup-tool which only works internal.
Click to expand...
Click to collapse
It can backup/restore your data, it can not backup your ROM/firmware, if you are not rooted, you will only be able to backup/restore user data, you will not be able to backup/restore any of your system apps/system app data, or any other part of system data and system settings, that will require rooting the device.
If you want a complete backup of the operating system and everything else on the device, you will need TWRP.
Sent from my SM-S767VL using Tapatalk
I am rooted. I am running TWRP.
I can't copy large amounts of data from inside the phone because something is buggy; this includes TWRPs backup-function. Copying works fine if and only if controlled by connected PC.
andy01q said:
I am rooted. I am running TWRP.
I can't copy large amounts of data from inside the phone because something is buggy; this includes TWRPs backup-function. Copying works fine if and only if controlled by connected PC.
Click to expand...
Click to collapse
Try flashing a newer or slightly older version of TWRP, it might fix the bugs that you are experiencing in TWRP. Is TWRP set to store your backups on external? Or is it set to store backups on your internal storage? Storing backups in internal takes up too much space, it's best to store backups on external.
As for adb...
https://forum.xda-developers.com/galaxy-nexus/guide-phone-backup-unlock-root-t1420351
There are several switches that can be used to be specific about what you want backed up and what you don't.
Sent from my SM-S767VL using Tapatalk
I updated to TWRP 3.4.0-0 (newest version) and backup from within TWRP still always fails between 20% and 30%. The last 30 to 40 backups failed and the only one that did finish to 100% is still broken and can't be read.
I would be thinking hardware-failure if not for the thing that copying anything from within the phone is super buggy, but copying when controlled from a PC works completely fine.
I guess I'll try the simple adb backup with some more parameters and then move on.
andy01q said:
I updated to TWRP 3.4.0-0 (newest version) and backup from within TWRP still always fails between 20% and 30%. The last 30 to 40 backups failed and the only one that did finish to 100% is still broken and can't be read.
I would be thinking hardware-failure if not for the thing that copying anything from within the phone is super buggy, but copying when controlled from a PC works completely fine.
I guess I'll try the simple adb backup with some more parameters and then move on.
Click to expand...
Click to collapse
How much free space do you have on internal storage? If there is less free space than your system, data and cache partitions combined, that may be why it is failing. Clear some space. I say this because when the backup is being created, the data that you want included in your backup is being read bit by bit from their partitions and then written into cache bit by bit and then it is read from cache bit for bit then it is written to its final storage location bit for bit. If there is not enough space to write it all into cache before writing it to its final location, it will fail.
The same rule applies when you move files from internal to external or vice versa, the same rule also applies when you are extracting files. It requires enough free space to write that data into cache before it goes where it is actually going.
Sent from my SM-S767VL using Tapatalk
Oh come on, I appreciate your efforts, but I felt being treated like a little child from your first answer and this tops it very much. Backup fails at 20-30% with 45GB of free internal space, external MicroSD removed and <10GB of data to backup. Aside from that I doubt that if a lack of free space causes the backup to fail, that this will not cause an error message to tell me what caused the fail.
By now I did the backups that I could backup:
That is I manually pulled all folders I deemed important.
Then I used "adb backup -apk -shared -all -system" which created a 7GB backup.
I also used the buggy migrate-app and ticked all boxes to get a 3GB backup.
And I used Googles cloud-service-backup.
In the end plenty of data and configurations were lost; worst is probably the Corona Warn App data as this can't be remedied.
andy01q said:
Oh come on, I appreciate your efforts, but I felt being treated like a little child from your first answer and this tops it very much. Backup fails at 20-30% with 45GB of free internal space, external MicroSD removed and <10GB of data to backup. Aside from that I doubt that if a lack of free space causes the backup to fail, that this will not cause an error message to tell me what caused the fail.
By now I did the backups that I could backup:
That is I manually pulled all folders I deemed important.
Then I used "adb backup -apk -shared -all -system" which created a 7GB backup.
I also used the buggy migrate-app and ticked all boxes to get a 3GB backup.
And I used Googles cloud-service-backup.
In the end plenty of data and configurations were lost; worst is probably the Corona Warn App data as this can't be remedied.
Click to expand...
Click to collapse
I can't help how you feel and you are entitled to feel however you wantl, but, at the end of the day, it is still only how you "feel", that doesn't make anything true or false. Just saying.
I didn't post anything to make you feel any kind of way, I was merely attempting to be as informative as I could because one can never gauge what someone else knows or understands before your interaction with them.
I've seen some other issues with TWRP backups failing and/or being unreadable, the solution is not a singular solution, there are several reasons why it fails and several fixes to solve it. Have you tried doing some google searches for:
"TWRP backups fail at 40%"
That pulls up some information that might apply or may not, you'll just have to peruse what you find to see if any of seems like it might be what you are experiencing and then try some of the solutions that others have tried. You might get lucky, you might not.
I'm more interested in helping you "find" an answer than whether I "know" the answer or "tell" you the answer.
Sent from my SM-S767VL using Tapatalk
Droidriven said:
Have you tried doing some google searches for:
"TWRP backups fail at 40%"
Click to expand...
Click to collapse
Yeah, I've done that for an hour or so before starting a thread - obviously b/c that has the chance for much quicker solutions and seems less work for me.
Also I did try several solutions like update TWRP, try smaller backups (the small ones do usually work) and so on. I think I did mention that I tried this over 40 times.
Some of the solutions suggest installing another ROM first, (apparently the ROM can cause Read-errors within TWRP?) but obviously I want the full backup before I try another ROM so I tried other methods to backup my data.
Also moving data via adb has worked completely without fail so far, so I wanted to try that path.
By now I can tell that TWRP full backup doesn't work on other ROMs either.
andy01q said:
Yeah, I've done that for an hour or so before starting a thread - obviously b/c that has the chance for much quicker solutions and seems less work for me.
Also I did try several solutions like update TWRP, try smaller backups (the small ones do usually work) and so on. I think I did mention that I tried this over 40 times.
Some of the solutions suggest installing another ROM first, (apparently the ROM can cause Read-errors within TWRP?) but obviously I want the full backup before I try another ROM so I tried other methods to backup my data.
Also moving data via adb has worked completely without fail so far, so I wanted to try that path.
By now I can tell that TWRP full backup doesn't work on other ROMs either.
Click to expand...
Click to collapse
Flash an older version or newer version of the exact same ROM as what you have but not doing any of the wipes, just flash ROM and that's it. This is called a "dirty flash", it will not wipe any of your data unless you specifically tell it to.
Alternatively, you could just do a backup via TWRP without including system and boot, just data and maybe cache(cache isn't necessary and might even cause issues if you restore it). Then, if you need to restore, flash the ROM the backup was created from then reboot to system, then boot back into TWRP then use "advanced restore" in TWRP to restore data and cache, this "should" give the same result as including system and boot in the TWRP backup along with data then restoring everything from that backup.
Also, can you post a copy of your recovery logs to some hosting site then link it here, someone here might be able to see something in the log that needs addressing, preferably the logs from the failed backup processes, if they errored in different ways, post the differences also. You should be able to find your logs if you haven't wiped the device.
Sent from my SM-S767VL using Tapatalk

Categories

Resources