[HOWTO] Backup and Restore Data on Android Devices

I have had another look at the ‘Android Backup and Restore Tools’ project which uses shell scripts on a Linux PC to backup and restore apps and data. I looked at it a while ago, but then I started using TWRP backup / restore instead. I decided to revisit this project as a possible alternative to TWRP for backup and restore, to see if it can offer a more flexible and fine-grained backup and restore, specifically for using a known set of user apps and data on different devices and phone models.

After a couple of days experimenting, it is looking pretty good. It will - with some exceptions - restore the same set of apps and data across different phone models. I have only tried devices running the same /e/ and Android version: using it across /e/ and /Android version updates is the next experiment.

It still does not seem to restore accounts, even if you restore the Account Manager app and data, so to use it on a fresh install you need to boot the system, complete the first time setup wizard (including adding an /e/ account), then enable adb root debugging, before you can restore the data. Have fun!

After a bit more experimenting:

  • restore seems to be architecture dependent: I started with a Sony Xperia XZ1 Compact lilac. Apps backed up from there mostly restore fine onto a Z5 Compact suzuran (which was the previous Xperia generation). I then tried on Z3 and Z3 Compact, which were an even earlier generation, and many apps began to fail, when installing apps with multiple apk files in the archive (e.g. app_com.DibsemSoftware.HowManyStrokes.tar.gz, contains the following split apks: split_config.en.apk split_config.arm64_v8a.apk base.apk split_config.xhdpi.apk ). Restoring that archive fails with the error Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113. These archives restored OK on Z5 Compact, but not on Z3/Z3C.

  • All phones involved were running e-0.19-q-20211029

  • So backups from one model may be restorable on some other models, but not all

  • ‘failed’ apps in this scenario include: Facebook Messenger, Telegram, Cluster, HowManyStrokes, Ebay, Evernote, Garmin Connect & Golf

  • these can sometimes be fixed, by replacing the split apks in the archive with a single APK, where one is available (e.g. for F-Droid apps)

  • Some restored apps keep stopping when run. These can be fixed by deleting app storage, meaning the apps can be restored, but the user data is lost

I’ll add more information here as I discover it.

12 Likes