How to install an update via TWRP on Xiaomi: Full Guide

The process of installing updates through Team Win Recovery Project (TWRP) is one of the most reliable ways to upgrade the operating system on Xiaomi devices. Unlike the standard “over the air” update, the custom recovery method allows you to bypass regional restrictions, upgrade from the Chinese version to the global version, or even roll back to earlier versions of the software without losing data.

However, before you start manipulating system partitions, you need to be aware of the risks. Any interference with the software part of the device requires care and accurate follow-up instructions. Wrong actions can lead to software errors, although modern recovery methods usually allow you to return the device to life. The key to successful firmware is the availability of an unlocked bootloader (Bootloader), without which installing any images through TWRP is impossible.

In this article, we will take a closer look at the preparation process, the search for compatible files, and the update process itself. We will look at the nuances of working with the Data and System partitions, and discuss how to avoid loss of user data. You will learn to distinguish between firmware types and understand why the order of installation of components is crucial for the stable operation of MIUI or HyperOS.

Preparation of the device and necessary files

The first step to a successful upgrade is careful preparation. You will need not only the firmware file itself, but also a specific version of the recovery adapted specifically for your smartphone model. There are no universal solutions here: the TWRP image created for the Redmi Note 10 can hopelessly “brick” the Xiaomi Mi 11 due to differences in memory markup and drivers.

The official Xiaomi Firmware Updater website or authoritative forums like 4PDA and XDA Developers are your best friends, and avoid dubious sites that offer “accelerated” or “modified” versions, as they may contain malicious code or be corrupted.

Also make sure that the battery is at least 60-70% charged, the process of writing data to non-volatile memory can be energy intensive, and a sudden shutdown at a critical moment can damage the boot partition. Before starting the procedure, back up important contacts and photos, even if you plan to save data.

☑️ Checklist before firmware

Done: 0 / 4

Finding and installing the correct version of TWRP

Finding the right recovery is a very careful task. The official TWRP project site often doesn’t contain builds for Xiaomi’s latest devices due to encryption and kernel specific requirements, and in such cases, you have to address topics on profile forums where developers post their builds.

Pay attention to the type of encryption that the TWRP version supports. For modern Android devices 11, 12, 13 and 14, it is critical that the recoveries work well with the encryption of fbe2 (File Based Encryption). If you install the old version, it simply will not be able to mount the Data partition, and you will not be able to save data or install the firmware correctly.

The image is installed in two main ways: the first is through a computer using the fastboot utility; the second is through an existing receivable or installer app if root rights are already obtained; the first install is most often using the Fastboot mode.

Connect your smartphone in Fastboot mode to your computer. Open the command line in the ADB/Fastboot tool folder and enter the command to firmware the image:

fastboot flash recovery twrp_image_name.img

After successful recording, it is important not to boot the system immediately.You need to exit Fastboot mode with a combination of buttons and immediately clamp Volume+ and!Power so that the device boots directly into TWRP. If you just restart the phone in the usual way, Xiaomi's stock system can replace the custom Recovery back to the stock.

What if TWRP doesn’t see internal memory?
If you see Internal Storage or Data partitions appearing as 0MB or unavailable after downloading to TWRP, you will need a decryption issue.You will need a TWRP version specifically assembled for your Android version, or you will need to run format data: yes in the Wipe section to unencrypt (this will delete all data!).

Update installation process: step-by-step instruction

When all files are uploaded and the device is in the TWRP environment, the main stage begins. The interface may differ depending on the build, but the logic of the actions remains the same. First, you need to go to the Wipe section. If you are upgrading from one version of Android to another (for example, from Android 13 to 14) or changing the firmware region, it is recommended to perform Clean Install.

To clean, select Advanced Wipe and tick the Dalvik/ART Cache, Cache, and Data sections. You don't need to touch the System and Vendor sections unless you're completely resetting from scratch. Slide the slider to confirm the cleanup. This will delete user data but ensure the stability of the new system.

If you just update the MIUI version within the same Android version and want to save data, you can't clean the Data section, in which case you can just clean Dalvik and Cache, and then go to the Install menu.

In the installation menu, click Images (if available) or simply select a firmware file. For full firmware (Recovery ROM) in zip format, simply select the file and confirm the swipe installation. If you use payload.bin images (extracted from Fastboot ROM), you will need a special script or application inside TWRP to unpack and install them.

📊 What type of firmware do you prefer?
Official Global Stable
Castom Assembly (Xiaomi.eu)
Chinese version with Google
Beta version of MIUI

Section management and data retention

Understanding partition structure is key to avoiding errors. Modern Xiaomi smartphones use dynamic markup or seamless updates (A/B) scheme, which means that the update can occur in the background to an inactive slot. TWRP must be able to switch the active slot.

When installing updates through zip archives, the installation script will determine which partition to write data to. However, when manually selecting images (for example, boot.img or vbmeta.img), you must manually specify the target partition. An error in selecting the target partition (for example, writing a boot image to recovery) can lead to a bootloom.

Pay special attention to the Data section. This is where your photos, apps and settings are stored. If a device goes into a cyclical reboot after installing a new firmware, it often helps to clean up Data, but this will inevitably lead to loss of information.

SectionDescriptionDo I need to clean when updating?
Dalvik / ART CacheCash compilation applicationsYes (recommended)
CacheTemporary system filesYes.
DataUser data and applicationsOnly when changing the Android version or region
SystemOperating system filesNo (replaced with firmware)

Possible mistakes and ways to solve them

Even with strict adherence to the instructions, there can be unforeseen situations, one of the most common problems is the Error 1 or Error 7 error when installing the zip archive, which often means that the TWRP version is incompatible with the version of Android on which the firmware is based, or the integrity of the file signature is violated.

Another common problem is a “bootloop” after installation. If you upgrade without a data cleanup (Dirty Flash), the conflict between the old settings and the new code can cause a failure, in which case returning to TWRP and running Wipe Data usually solves the problem.

⚠️ Warning: If the device doesn't turn on or respond to buttons after firmware, the bootloader or critical partitions may be damaged. Try entering Fastboot mode and recovering the stock image via the Mi Flash Tool.

Also worth mentioning is the issue of losing IMEI or VoLTE that is broken.This can happen if a Modem or EFS partition is damaged when you are firmware. Always check the integrity of these partitions before starting any manipulations by backing them up in TWRP.

💡

Expert advice: Before installing a major update (for example, switching to a new version of Android), always make a full backup of the Data partition to an external computer or cloud. TWRP allows you to create a full copy of the partitions in tar format, which is the most reliable way to save the state of the system.

FAQ: Frequently Asked Questions

Can I upgrade to TWRP without losing data?
Yes, this is possible if you upgrade within a single major version of Android (e.g. MIUI 12 to MIUI 13 based on Android 11). However, when switching to a new version of Android (e.g. 12 to 13), it is strongly recommended that you clean up the data completely to avoid errors.
What if TWRP says "Failed to mount /data"?
This means that the recovery cannot decrypt the data partition, so you either need to find a TWRP version that supports encryption for your Android version, or run a Format Data command that will delete all the data from the phone.
Do I need to re-flash TWRP after each system update?
Not always. If the system update doesn't affect the Recovery partition, the old version of TWRP may work. However, after major Android updates, the old version of the Recovery may stop mounting the partitions properly, so it's better to upgrade it.
Is it safe to use TWRP for banking applications?
TWRP itself does not affect the operation of applications in a running system, but having an unlocked bootloader and a modified backup can block Google Pay or banking applications due to SafetyNet/Play Integrity security checks, which are solved by root rights and Magisk modules.

💡

The main takeaway: Installing updates through TWRP gives freedom, but it takes responsibility. Always check the compatibility of the backup and firmware versions, do backups, and don't be afraid to learn the error logs if something goes wrong.