Backup and Upgrade Android Devices

This articles keep track of all lessons learned while doing backsups or AOSP upgrades.

Backup using adb from platform-tools

A backup of all system data and apps can be done using adb:

$ adb backup -all -f 20160508_android_backup.ab

Options are

apk        – Backs up your apps.
noapk      – Does not backup apps.
shared     – Backs up data on the SD card.
noshared   – Does not backup data on the SD card.

A complete backup can be done as follows:

$ adb backup -apk -shared -all -f 20160508_android_backup.ab

The smartphone has to be unlocked after execution. The backup starts after an optional password request.

To restore the whole backup execute:

$ adb restore 20160508_android_backup.ab

For more options when restoring the adbextractor can be used.

A howto can be found here.

Backup using OrangeFox Recovery

Upgrading

Backup your device first.

Upgrade LineageOS from older version to the next version.

In general you are not able to use the system updater to upgrade e.g. from version 20 to 21. But what you can do is to download the version and conduct a locale upgrade manually.

GAPPS

Use ARM64 version for your device from Google Apps.

$ adb -d reboot sideload
$ adb -d sideload /path/to/zip