How to take an ADB backup of your phone using TWRP v3.1.0-0

2
ADB backup using TWRP v3.1.0-0

TWRP has been updated to v3.1.0-0. The new version of the recovery is already set and rolling out for the supported devices. Below is the changelog for as mentioned on the original website.

TWRP v3.1.0-0 Changes

  • vold decrypt on a few select HTC devices, TWRP will now attempt to use the system partition’s vold and vdc binaries and libraries to decrypt the data partition (nkk71 and CaptainThrowback)
  • adb backup to stream a backup directly to or from your PC, see documentation here: https://github.com/omnirom/androidbootablerecovery/commit/ce8f83c48d200106ff61ad530c863b15c16949d9 (bigbiff)
  • tweak MTP startup routines (mdmower)
  • support new Android 7.x xattrs for backup and restore to fix loss of data after a restore (Dees_Troy)
  • support POSIX file capabilities backup and restore to fix VoLTE on HTC devices and possibly other issues (Dees_Troy)
  • better indicate to users that internal storage is not backed up (Dees_Troy)
  • improve automatic determination of TW_THEME (mdmower)
  • minimal getcap and setcap support (_that)
  • try mounting both ext4 and f2fs during decrypt (jcadduono and Dees_Troy)
  • shut off backlight with power key (mdmower)
  • timeout during FDE decrypt (Dees_Troy and nkk71)
  • support for FBE decrypt and backing up and restoring FBE policies (Dees_Troy)
  • boot slot support (Dees_Troy)
  • TWRP app install prompt during reboot (Dees_Troy)
  • support for AB OTA zips (Dees_Troy)
  • support new Android 7.x log command (Dees_Troy)
  • update recovery sources to AOSP 7.1 (Dees_Troy)numerous bugfixes and improvements by too many people to mention

You are now allowed to take Nandroid backups over ADB using TWRP v3.1.0-0. The process however can only be initiated from the client side (In simpler words, from your computer). We will talk about it in much detail, a bit later.

The next notable feature being introduced is specific to the Pixel/Pixel XL users with A/B partition format, where the users will now be able to flash alpha/beta OTA update zips from within the recovery.

The update also adds support to a list of new devices, including:

Go ahead and update to the latest TWRP, either manually or by using the Official TWRP app.

How to take ADB backup using TWRP

Over to the ADB backup functionality that TWRP is offering with its latest update. No, if you’re thinking that you would be able to generate a backup using ADB over WiFi, we are sorry to disappoint but this is not that. You will still need to make a physical connection with the PC using a USB cable.

You can use the command-line tool on your PC to execute the appropriate commands and take the backup of the known partitions of your device.

To begin, you must have ADB set up on your PC. You can either follow our tutorial to setup Android SDK and platform tools, or simply use the standalone package. And of course, your device must be booted into TWRP recovery and connected to the PC.

  1. On a whole the ADB backup command follows the below structure.
    adb backup -f <filename> --twrp <options>
  2. The -f switch specifies the filename being added. <filename> could be anything according to your preferences. However, if you choose to leave it empty, the backup will reside under backup.ab, by default.
  3. <options> let you use the following options, depending upon the partitions you want to backup.
    --compress : Compress the data
    
    system : backup system partition
    
    cache : backup cache partition
    
    data : backup data partition
    
    boot : backup boot partition
    
    etc : backup each and every partition your device has
  4. Only boot, data, and system partitions are backed up by default. So without any arguments, a generalized backup command would be:
    adb backup --twrp

    ADB backup using TWRP

  5. You can make use of the arguments to customize your backup. So a more advanced backup command should look like:
    adb backup -f firstbackup --twrp system data cache boot
  6. As soon as you execute the backup command at the client side, the backup screen will open on your device. Then unlock your device and confirm the backup process.
    Conform ADB Backup process on TWRP
  7. You can use the following command on the client side to restore a backup:
    adb restore <filename>

    or

    adb restore backup.ab

View TWRP’s github for complete documentation.

The ADB backup functionality will work with all the supported devices. If your device still hasn’t received the update, you can track the builds here.

Don’t forget to share this article on your social profiles by clicking the buttons below. Didn’t understand something? Let us help you. Just comment below.

  • Henok Girma

    Hey everyone. So i had no problems making the backup and proceeded to flash an update with Flashfire. However, after reaching the boot animation, it would slow down (the animation) and won’t start. I’ve tried the ‘adb recover backup.ab’ command 4 times and nothing happens on the phone. PLEASE HELP.

    • the command should be “adb restore backup.ab”. However, it will only work when your device is in OS. You can try transferring the backup from the PC to the device storage under TWRP/BACKUPS/ and then try restoring from the TWRP restore menu.