[HOWTO] Backup and Restore Data on Android Devices

Does LAB not backup and restore data? Or is using it just a ‘belt and braces’, ‘just in case it doesn’t work’. multi-tier approach?

I was not prompted for root during backup or restore. It uses adb for access and commands.

Sadly, app data is not backed up, as confirmed here…
Issue # 24 (Question on apk files data backup)

External data will be present (/sdcard/Android/), so only half good. Folks will still have to reconfigure their apps.

sigh All folks want is to retain their settings without having to jump through hoops or root their phones.

Also, missed the chance to see if App Manager could restore data in adb mode. I accidently deleted its backup directory. Good thing I wasn’t relying on that. :open_mouth:

Yes. And I can do that using the Android Backup and Restore Tools on a linux computer. I was hoping that LAB might give us that functionality on MacOS (and on Windows if people insist on using it :wink: ). Looks like I’ll have to make start on trying to get AB&RT runnng on MacOS

Well, after awhile I discovered that LAB’s internal storage restore didn’t work out so well.
Found out that only a fraction of my images were restored. During restoration I did see some errors regarding .thumbnails or some such. Before noticing my issue I did read an issue on the github where it seems that when said errors occurred nothing else in the affected directories would get restored and it moved on.
So in my case only images in the top-level Pictures were restored. All subdirectories were omitted. That’s not good.

Later, when I was about to restore my SMS/MMS messages with SMS Backup & Restore, its directory wasn’t present. ???
Another directory for my office suite was only partially populated. With those discoveries and more I wound up having to do a manual compare and restore from the external drive to the phone.

I’m about to do another ROM change on that phone. Next time I’ll try AB&RT as it sounds more reliable.

Worth giving SMS Import / Export a try for baching up messages and call logs. I don’t think AB&RT handles those. Also, worth hunting round for the SMS B & R backups. On my device they’re in a directory called smsbackup on my external SD card

For SMS B & R I have a set directory. It just didn’t get restored by that backup script.
On phones with external SD card, yes, I definitely put it there. The OP8T doesn’t have one (boo, hiss). Have the pro version so maybe I should take advantage of the webdav backup feature, just in case.
I do use SMS I/E elsewhere. Turned out to be a nice app.

Edit, I wrote this before seeing your later post saying no SD card present.

I have also had this but not every time! I speculated that allowing permission within the SD card was unreliable. I now take a SMS Backup & Restore on the “New” device first, then use that location for the files I wish to restore. Currently most of my backups are on the root of the SD card with only one pair of backup files in SD_card/SMSBackupRestore.

Yet another example of why a phone with SD card was mandatory for me. There’s a certain piece of mind there (not that the slot or card can’t fail, but still).
That fact that I wound up with two devices without surprised me. And I’ve been hit by a disaster or two on such devices.

Oh, should’ve mentioned that my SMS Backup & Restore directory was on the external drive so I didn’t lose anything.

Not sure if it fits here, maybe mods want to change whereto it belongs?
I try to restore a data partition from one device to another (same device Xperia Z5 Compact) and same TWRP version (3.2.3-0).
It gives me an error 255.
Been through lots of sites on XDA, but didnt found a solution yet.
I guess its probably an easy one as I didnt do something very special.
Device is not rooted and even on the same OS version as the one where I made the backup at the moment. Plan is (or was…) to restore the data on an updated version of the OS on the other device (from q1.4. to r1.4.)
I dont find any folders named 999, never had parallel apps or multiple users, backup has no subfolders…
In the end I would be happy if at least could restore my contacts as I dont use any cloud for this (yet :wink: )
I am using an external SD card for the tranfer. Devices are not rooted (I never did this because I never needed it).
Ayn help would be great! :slight_smile:

Both phones need to have the same screen lock pattern (or PIN). I believe this is used to encrypt/decrypt the backup. If the original phone had no screen lock, then I believe a device-specific key will have been used to encrypt, which will not be available on the target.

I’m not *sure about the above, but it may be worth rehdoing the backup with a screen pattern

Oh wow. Never been into encryption though its defenitly interesting.
I have no screen locks on both devices other than “wipe the lockscreen”.
I cant redo the backup as the device is already clreared completely.
Yes, I made some mistakes in the thought process and then in the practical one also… :slight_smile:

Then I think the backup is encrypted with a device specific key . Are you able to restore it on the original device? If you can, you can then set a screen pattern(3x3 dots is easy to use) and make a new baackup (which should be encrypted with a key based on the screen pattern).

If you can’t restore it to the original device, then I’m afraid you’re out of options :frowning:

@petefoth already covered this idea, but … using different words, I would restore your Q /e/ version, with Format Data on the basis that you say the device is cleared completely.

Then I would expect your TWRP Q backup to restore successfully. (I would see encryption as an important issue, but we do not yet know if this is your primary issue, imho.)

Should that fail, my apologies.

If the Q backup restores successfully to /e/ OS 1.4, you would then be in a position to use a TWRP backup as part of your backup strategy when upgrading to R.

Thanks guys, the backup didnt restore on the q1.4 with data formated, I did try that already :frowning:
Thanks for taking care!

Also very handy for backing up and restoring data outside of TWRP is Linux Android Backup. Despite its name it also works on MacOS and Windows.
https://mrrfv.github.io/linux-android-backup/

3 Likes

Unfortunately it is only a incomplete backup. All data that is only accessible in the system-partition is not backed up. That means: No App settings, no stored WiFi-networks, no Account-logins…

1 Like

It’s enough for the average user, I think. For me, I can set up the rest manually after restoring the backed up data.

Hello, The goal would be to avoid to spend a lot of time resetting every app and system parameters after a restoration. Maybe the seedvault backup can be improved to include all system parameters even if some apps will still refuse to be backed up

Thanks @Klaas! The project has a new name and now a new link: https://github.com/mrrfv/open-android-backup

2 Likes

Unfortunately TWRP cannot backup and restore data on the current /e/OS releases if they originally came with Android below 12. I added this to the HowTo:

TWRP cannot decrypt the data partition of devices that have Android 12+ (/e/OS S+) installed but did originally come with Android 11 and below. (E.g. Fairphone 3 originally came with Android 9.) Thus you cannot backup and restore the data on such devices with TWRP any more.