[HOWTO] Backup and Restore Data on Android Devices

See the reply from @AnotherElk

All of my phones have TWRP installed on the recovery partition. More recent phones apparently d things differently, but I know very little about that :slight_smile:

Yes. But …

hooray. Just wiped my phone, trying to flash twrp. I knew I should save my pictures first, but I thought I will backup my pictures afterwards, bc I’m just trying to install the Backupstuff. Very pissed right now.

Why does this Tutorial not start with, “you’ll wipe your data if you try to flash TWRP?

I guess because

  • this isn’t true on every device.
  • on devices where true would need active running of wipe command by user or user consent to wipe, as far as I understand. (Or does locking/unlocking the bootloader not ask for consent for the included factory reset? I don’t remember, unfortunately.)
  • because until now apparently nobody added something like this to the tutorial. It’s a Wiki post, feel free to, “Edit” button at the bottom right of the tutorial post.
3 Likes

Because I have never known installing TWRP to cause loss of data. Unlocking bootloader will cause loss of data, but that is not covered by this tutorial.

What steps did you follow to flash TWRP. What device are you using?

Files I copied from TWRP MTP mode all got the same timestamp something in 1970 - unusable for backup of only changed files - like I do with FreeFileSync with device connected via USB
I got twrp-installer-3.5.2_9-0-FP3 installed

actually the only reliable tool I’ve got is Titanium - up till now only Signal didn’t work after recovering

Interesting. I can confirm that the current TWRP 3.6.2_9-0-FP3 using MTP offers no change timestamps. I’m using Windows 11 Pro on the computer side.

And apparently this isn’t entirely new, although seemingly dependent on the device or on the computer OS … https://github.com/TeamWin/Team-Win-Recovery-Project/issues/1065

I just asked the TWRP maintainer for Fairphone 3/3+ … let’s see.

FreeFileSync got that working reliably? There were a bunch of MTP problems reported in the past.
Anyway, doing this sync with /e/OS booted is not an option (since you mentioned Titanium)? The timestamps are there when /e/OS does MTP.

1 Like

I must admit, I’m not shure if it worked with my /e/-installation.
It works with my Lineage-install. I’m using it regularly to synchronize files between my FP3 and Win10(pro)-Computer. Should work for /e/ just the same - a lineage-fork - isn’t it :wink:
actual IMG-e-1.2-r-20220727206630-dev-FP3 I tested bases on lineage 18.1
I actually use latest 18.1-package
lineage-18.1-20220620-nightly-FP3-signed.zip

Thanks for your answer. Stepped away from the forum for some days :slight_smile: Aehm. I do not know exactly anymore which steps I followed, but mostly internal documentation about TWRP and unlocking the bootloader. Maybe XDA too. Should have read this first “✏ FP3: unlock the bootloader - Guides - Fairphone Community Forum

I’m using the Fairphone 3.

So, used the wipe to flash Android 11. But now my build-number seems suspect to me: “eng.root (…) dev-keys” is not what I wanted. Bootloader is locked, but SafetyNet is not working anymore, CTS profile does not match.

Android 11 (R) currently is only available on the dev release channel, still marked as beta …

https://images.ecloud.global/dev/FP3/
https://images.ecloud.global/stable/FP3/

You can compare these download filenames most easily to Settings - About phone - Android version (tap on it) - /e/OS version (it has the same version string format).

1 Like

Thank you for digging those posts! I had no luck with my keywords :slight_smile: Seems like, I need to reflash or do you think there might be a chance, that once Android 11 is out of beta, my build-number gets “stable”?

You will need to reinstall for stable. The dev beta will just stay dev once out of beta.
Changing the release channel is always a new install.

But you can only install Android 10 (Q) currently as stable. An OTA upgrade to Android 11 (R) is just announced without a timeline, until then upgrading to Android 11 (R) would be a new install again.

1 Like

On the (rooted?) software angle, has anyone used App Manager for backups?
The new version 3.x of the app now can import backups from apps considered EOL/old/abandoned; such as oandbackup, Titanium Backup, and SwiftBackup.

On my Essential PH1 I originally had /e/OS Nougat and used TiBu and oandbackup. When I moved up to Pi/e/ I stilled used TiBu, but only for data restoration. Since Oreo, restoring of apps has resulted in problems so I install apps manually or via app stores and then restore data. While I was on Pie I would also do backups with OandBackupX (Neo Backup now) in addition to TiBu, just in case. When I moved to Q I was still able to restore data with TiBu without issue (save for those I knew data restore wouldn’t work such as Schildichat, Linphone, etc.).

AM v3.x was released after the move to Q so I haven’t had a chance to check out how well it will restore data from imported backups.
No way to test at the moment. I do still have a multibooting Oreo device where I guess I can test that but…

FYI, for non-root users, App Manager also operates via ADB over TCP and Wireless debugging so root isn’t needed. Just a bit more involved.

I already tried using App Manager for backups, about 6 months ago (it was a 2.x version).

I took the backup using TCP/IP root mode, seems quite complete.
But, when I tried to restore it on the same device after a full reset (same Android version, more recent build), the restore was not as good as expected : while some apps were fully working, some won’t launch at all, other were missing some files, etc.

I plan to build a new version for my perseus (Xiaomi MiMix3) with Android R, so if the build is successful I may attempt to use AM 3.x for a Q->R backup/restore of my apps …

Yeah, apps not working properly after restore has been an issue since about Oreo due to new security stuff. I missed being able to flash a zip of core apps (TiBu’s update.zip) when I setup a new ROM.

Now I archive apps/apks and install them manually. Then only restore the data.

By the by, the old ancient My App List (from 2014) turned out to be a great tool for quickly reinstalling apps from the app stores (via share dialog). It worked so well when I was moving between OxygenOSes and then to custom ROMs (Android 11) I made plans to do a write-up, with screen recordings of it in action. Laziness and procrastination set in. :sleepy: May still do so.

It’s a problem with SeedVault too.

It’s less of a problem with Android Backup and Restore Tools project. That needs root or rooted debugging, but if you’re using App Manager then you already have root. Why not give it a try?

AM works perfectly without root (lacking some functionalities, of course). That’s my case as least.
So: AM != root :wink:

Sorry - my mistake. I missed the bit in @marcdw’s post about AM and non-root users

1 Like

Having time on my hands (currently unemployed) I deciced to do some ROM testing on my Oneplus 8T.
Was running Carbon ROM (my go-to). Finally decided to try the Linux Android Backup tool after I saw the app show up in F-Droid (IzzyOnDroid repo). Heretofore known as LAB.

On Linux I ran the backup script and followed all the prompts. It installs the aforementioned app to backup contacts and then proceeds to backup all apps (but apparently not their data if I read correctly at the github) and internal storage. That went without a hitch.

The next day I tested /e/OS on the OP8T for fun. Later I installed CorvusOS and decided to see what happens if I tried the LAB restore. Knowing that I’m on a different ROM it would be sure to break things but that was okay.
The restoration went well. It didn’t fail but there were some errors/warnings. For instance I had Termux installed on Corvus because I needed a terminal to deal with some microG permissions but forgot to uninstall it before the restore. CarbonROM had TEL (Termux Expert Launcher) which has the same package name as Termux. During the restore TEL didn’t get restored due to signature mismatch. Otherwise everything else was restored including all the internal storage stuff. There were some adb errors at the end but nothing that stopped the restore.

When I went back into the ROM all the apps I had installed on Carbon (other than the TEL stuff) was there. Surprisingly nothing was broken in the ROM so that was good. Probably because only user apps are backed up and restored.
For safety reasons I figured I’d reflash the ROM, wipe data, and reinstall the apps fresh. I did two /data wipes but nothing was removed. All apps and the ROM settings were still intact. Odd.
Using OrangeFox recovery by the way. On the second wipe I clearly saw that directories and other items were gone, yet I guess not.

As far as backing up contacts, not sure what happened with restore. When I brought up Contacts there was nothing there. Not a problem for me since I use EteSync anyway but not sure what happened. May have missed an error message regarding that.

In general though it seems that Linux Android Backup worked fairly well. I used Neo Backup to restore data. A mult-tier approach is always good. Just in case I did manually copy /sdcard/ contents to an external drive,.

Sidenote: I have never trusted USB-powered external drives. Random loss of power or going to sleep and not waking up, failures to write, etc. Awhile back I put a 500GB SSD drive in an AC-powered UGREEN 3.5" enclosure. Inexpensive but so far no issues and reliable.

3 Likes

That looks really interesting. No mention of root on their github. Can you confirm whether it works OK with an unroofed phone? Thanks