1

Before handing in my OnePlus 6T for repair, I want to create a full system backup and reset the phone to factory defaults. Afterwards, I want to restore the original state. My phone is rooted with Magisk.

How do I do a full system backup?

Note that this is different from a backup as part of migration to a new phone or a partial backup as part of fixing software issues.

6
  • what do you mean with full system backup? and what do you mean with restore original state? usually just data backup is required. adb backup does not fulfill the needs, look for other tools like Titanium or Migrate or use adb pull to get a disk image. for full system backup use TWRP recovery (be aware Internal Storage is not included in TWRP backup)
    – alecxs
    Commented Jul 6, 2020 at 8:07
  • What I mean by full system backup is a backup that I can use to restore the device to the exact same state as it was before I did a factory reset. So all applications on all screens should still work as before, all the photos should still be there, etc. Note that I do additional individual backups of data. However, in order not to waste a lot of time for restore, I just want to do a full backup and restore. I tried OnePlus Switch. That restored applications, but not their settings. It was not of much help.
    – feklee
    Commented Jul 6, 2020 at 8:51
  • @alecxs Note that I don't need to use adb. I was just showing what I tried. If TWRP is the better tool, then - with a bit of details - that would be a good answer.
    – feklee
    Commented Jul 6, 2020 at 8:59
  • 1
    There exist a number of similar questions. See backup, titanium-backup and twrp tags. Also how to backup. From TWRP official site: What should I back up in TWRP? and What is EXCLUDED from a TWRP backup? Commented Jul 6, 2020 at 9:28
  • factory reset does only format userdata partition, therefore no system backup needed. be aware when restoring userdata backup, issues for which you wanted to reset will be restored back, too. for TWRP Migrate is recommended for selection what apps to restore
    – alecxs
    Commented Jul 6, 2020 at 11:30

1 Answer 1

1

Note: This method will not work with work profiles or parallel apps!

Here's how I performed the backup on a OnePlus 6T in 2020:

  1. Downloaded TWRP for my device.

  2. Rebooted the phone into fastboot mode by pressing volume down plus the power button and following the menu displayed on the phone. Note the process of entering fastboot mode varies from phone to phone.

  3. Connected the phone to the PC, then booted TWRP from the Windows command line (cmd.exe):

    fastboot boot twrp-3.4.0-0-fajita.img
    

    I installed fastboot as part of the Chocolatey package adb.

  4. In TWRP, I entered my password, then selected Backup.

  5. Backed up all partitions to internal storage. See also the TWRP FAQ: What should I back up in TWRP?

    Note that not all partitions need to be backed up, and in fact, according to the TWRP FAQ, it may be a bad idea to restore certain partitions. Still, it doesn’t hurt to have the backup of all of them.

    Not included is /data/media (internal storage). This needs to be backed up separately. See the TWRP FAQ: What is EXCLUDED from a TWRP backup?

  6. With TWRP running, I connected the phone via USB to my PC. Then I moved the following folder to my PC, which contains the TWRP backup of the phone:

    This PC\OnePlus A6013\Internal Storage\TWRP
    

    This step is not strictly necessary as in the following step I did back up the entire internal storage. However, it makes the next step execute faster as less data needs to be copied. The next step does not give feedback about progress.

  7. For backing up internal storage I decided on the method found in Tadej Janež’s article Backing up Android's /data/media (i.e. internal storage) using adb and TWRP. From the Windows command line I ran:

    adb exec-out "tar --create data/media/0 2>/errors.txt | gzip" >internal_storage.tar.gz
    

    After completion, to check for errors, I ran (no errors):

    adb shell cat /errors.txt
    
  8. To leave TWRP, I rebooted the phone. Note that it is not necessary to install TWRP.

Restoration still needs to be tested.

0

Not the answer you're looking for? Browse other questions tagged .