TWRP and backup

Google Backup

Sometimes the Google Backup button is greyed out. This is due to mismatch in pincode/fingerprint. You need to wipe the existing backups from Google Drive.

Use adb commands:
bmgr cancel backups
bmgr wipe
bmgr backupnow --all

Now goto the Google Backup settings in the GUI and the button should be usable again.


TWRP backup

Maybe you have heard of TWRP (Teamwin Recovery Project). One of the Android partitions in your device is called Recovery.

You can boot into Recovery by holding certain harware keys during boot or use the adb boot recovery command.

Recovery images exist of a bootable kernel (device specific) and binary programs: the GUI.

In Recovery mode the manufacturer provides a mean to wipe your /data partition or it is used to upgrade your device with OTA update.

That is not very exciting. That is why custom recovery images were developed during the years by the community. These provided options like flashing custom ZIP files, backup/restore of selectable partitions like /system /data and /cache, change files in the /system partition, etc.

One of the first was CWM recovery (ClockWork Mod). Today you see more custom recovery images. Best known is TWRP.

When installing TWRP your bootloader must be unlocked. If it is locked you cannot write anything custom to the device's partitions.

The easiest way to replace the manufacturers recovery is in "fastboot" mode, or with the flash software like for Mediatek.

Full phone backup

Sometimes you want a full phone backup. For example if you want to test another ROM. You want to backup at least:

    • /boot

    • /system

    • /data

Or in general the partitions that are overwritten by the new ROM. But there is a caveat. The userdata partition also contains your "internal sdcard".

The folder /data/media/0 is mounted at /sdcard. When backing up /data with TWRP the /data/media is excluded.

So how to proper backup all the data partition, including your internal storage (/sdcard)?

First you need a 32 GB micro sdcard or a 32 GB USB flash drive with OTG usb cable. You need this external storage for the full backup.

TWRP can backup/restore to 3 location:

    • internal storage (/data/media/0)

    • external sdcard

    • OTG

Backup 2 steps

Attach the external storage and reboot into recovery mode.

Make a backup of boot, system and data to internal storage (/sdcard/TWRP/BACKUPS/...)

Now make a backup of internal storage to your external storage (microsd or OTG)

This last backup is a backup of your internal sdcard, holding the backup of your boot, system and data in /sdcard/TWRP/BACKUPS/...

Now you have your complete device on external storage!

Restore 2 steps

Attach the external storage and reboot into recovery mode.

Format /data partition

Now restore from external storage your "internal storage" backup

When complete Restore from "internal storage" your boot, system and data

Reboot

So both backup and restore are a 2 step process, nesting one in another. It works perfect.