I have two FP2s, and I would like to copy the contents of the first to the second. The first is under LOS 17.1, rooted through Magisk, and the second under FPOOS, though freshly reset, and rooted through the developer options. Both have latest build.
What I tried:
Backup phone 1 through TWRP on SD card
Put SD card in second phone
Flash TWRP on the second phone
Backup second phone through TWRP
Copy the backup of the first phone in the folder of the second phone (otherwise TWRP doesn’t find the backup)
Wipe System, Data, Dalvik and Cache
Restore the backup of the first phone
Wipe Dalvik again (I’m not sure this is needed)
Flash Magisk
Reboot phone
And there I’m stuck on the LOS boot screen.
Further information
TWRP version for both phones: 3.3.1-1
I tried different variations of what I said above (Not flashing Magisk, not wiping Dalvik, etc…), same result each time.
Restoring the backup of FPOOS works without any problem.
Has anybody an idea? Did I do something wrong?
I did a few searches, but I found nothing interesting.
Since LineageOS 17.1, a full backup of LOS actually only provides a backup of your data. It won’t restore the system. @oli.sax’s good advice: Newly install LOS through TWRP, then (without booting in between!) restore the data part of your LOS backup. Now boot into system.
Try to understand what you’re doing so you understand what’s failing.
You’re doing a NANDroid backup, which is a collection of the NAND backups for each Android partition. A NAND backup is a raw backup, or an image, of the filesystem residing in a partition. Those partitions include system and boot —those that you would discard for a new OS—, and data. That data image is specific to FPOOS.
Then you’re trying to restore that data image to a fresh Lineage OS 17.1 installation, expecting it to work, despite being two different Android versions and also being signed by two different developers.
Sorry, that’s quite incompatible nowadays, Alex. You need to backup each app with something like OandbackupX (libre) or Titanium Backup (closed source) and then restore those.
Edit: Oops, I think I undestood something wrong. Do you want to CLONE a LOS installation from one device to the other?
Thanks for the explanation @Roboe, I am well aware of that, but I think you didn’t understand what I meant
I wiped everything from the second phone (which was running under FPOOS) and want to copy identically the system, boot and data partitions of the first phone (running LOS 17.1) to the second.
I think @urs_lesse’s explanation is rather what I am looking for.
I’m under the impression that TWRP 3.4 is one of the better releases of TWRP to the date. It fixed most of my problems with various devices. Give it a try and tell us.
Also, if system is well-backed up, then I don’t see any reason to re-flash Magisk.
TWRP 3.4.0-0 doesn’t change anything.
As @urs_lesse said, a backup of LOS won’t restore the system correctly. According to my brother, it’s because Lineage needs something to boot that isn’t backed up by a Nandroid backup, and so it gets stuck on the boot screen. @urs_lesse’s solution surely works, but my brother wants to do it in another way. Though we won’t do it this evening, I’ll tell you more tomorrow and keep you updated.
Then we tried with my brother the following procedure, which is by the way a very convenient way of backing up the internal storage:
In TWRP file manager, rename /data/media to something else, for example to /data/mediabak
Do a backup
On the other phone, wipe Data, System, Cache, Dalvik and Internal Storage
Restore the backup
Don’t reboot!
In TWRP file manager, suppress /data/media
Rename /data/mediabak to /data/media
Reboot
But it had the same result.
So I reinstalled LOS as suggested by @urs_lesse, following @oli.sax’s good advice
I followed nearly the same steps except for the LOS installation.
In TWRP file manager, rename /data/media to something else, for example to /data/mediabak
Do a backup
Wipe System, Data, Cache, Dalvik and Internal Storage
On the other phone, install LOS.
Restore the backup but only the Data partition
Don’t reboot!
In TWRP file manager, suppress /data/media
Rename /data/mediabak to /data/media
Reboot
Et voilà, I have LOS running smoothly on the second phone with all the data and the internal storage.
I could perhaps do a wiki about how to back up internal storage with the following steps, for anyone interested, with more detailed instructions and screenshots. What do you think?
I suggest adding a note about making sure the backuo is saved to the SD card, since wiping Internal Storage in the next step is dangerous otherwise.
Is this the only step that changes?
Do the new system have Magisk and other mods installed? I don’t think so, since it’s a fresh installation and, to my knowledge, mutating mods are stored on /system and inmutable ones could reside in /data, but need to be hooked somewhere else (I guess at /boot, but I can’t ensure anything, since I haven’t ever used them to date).
W-e-i-r-d workaround. Documenting it will serve others well,
Nope, you have to flash Magisk again (and other mods).
Sure, I will do this when I have time with proper explanations and screenshots. Though I don’t know what could happen if you reboot when I wrote “Don’t reboot!”.
My brother had found the trick on an xda thread.
Edit:
Yes it is, because instead of restoring the system (which is for a reason I don’t know is broken under LOS 17.1), you install it and then restore the data partition.
I think I will do a wiki for devices under any OS, and add a N.B for LOS users about what’s special.