How to Upgrade Xiaomi with Root Rights Without Losing Access

Xiaomi smartphone owners who have been granted super-user rights through Magisk often face the dilemma of updating the operating system or keeping the advanced features. OTA-Over-The-Air on modified devices often results in errors or cyclical restarts, due to the integrity of the system partition when booting.

There are several proven methods to solve this problem, allowing you to upgrade to the current version of MIUI or HyperOS. The choice of the particular method depends on whether the unlocked bootloader is used and which custom firmware or patch is used. In this article, we will discuss the algorithms of actions that minimize risks and preserve Root access.

โš ๏ธ Attention: Any manipulation of system files and bootloader carries a potential risk.Be sure to create a full backup of important data before starting the procedure.

Understanding the security architecture of Android on Xiaomi devices is critical to a successful upgrade.The system uses a boot partition verification mechanism that blocks the start when changes are detected, which is why a simple update through the settings menu often โ€œflysโ€ or does not install on devices with modified boot.img.

Preparation of the device for the update procedure

Before you start any action, you need to make sure that the current system is stable and that all the necessary tools are available. The store must be installed correctly, and the rights of the superuser are active. Ignoring the preparatory stage can lead to data loss or inoperability of the gadget.

You will need to download the current firmware version for your model. It is important to choose the file that corresponds to your current region and firmware type (Global, EEA, China).

  • ๐Ÿ“ฑ Charge your smartphone to a minimum 60-70%, Because the process of refrigeration is energy-consuming.
  • ๐Ÿ’พ Free up at least 10 GB of free space in internal memory.
  • ๐Ÿ”— Make sure that USB-cable is serviceable if you plan to connect to a PC.

It is also recommended to disable automatic updates to Google Play apps during work to avoid background conflicts. Check the Magisk Manager version - it should be up to date, as older versions may not work properly with new Android 13/14 security patches.

โš ๏ธ Warning: Don't try to update if the storage has encryption that you can't get around.In some cases, the update changes the structure of the encryption keys.

Method of saving Root during OTA-update

The most common scenario is to try to install an official update that came in through the air. If you just click the Update button, the system will check the hash amount of the boot partition, detect Magisk modifications and interrupt the installation. To get around this, you need to temporarily restore the original boot image.

The idea is to turn off Magisk before you install the OTA, update it, and then re-patch the new image, and this allows the system to update itself, thinking it's clean, and then you reclaim the superuser rights.

๐Ÿ“Š What type of firmware do you have right now?
Global (Global)
European (EEA)
Chinese (CN)
Custom ROM (Custom ROM)

In Magisk, find the Remove or Restore the Original File button. After that, restart. You can now start the OTA installation via the standard Settings โ†’ About Phone menu. If the update requires a reboot, don't panic - the system will update, but the Root will temporarily disappear.

After successfully installing the new version of the software and the first download, you need to open Magisk Manager again. Select the "Install" option and specify "Install in the Inactive slot (after rebooting)" This will apply the patch to the newly updated partition.

  • ๐Ÿ”„ Launch Magisk and click on the โ€œInstallโ€ buttonยป.
  • ๐Ÿ“‚ Select the method "Install in an inactive slotยป.
  • ๐Ÿ“ฒ Click โ€œStartโ€ and wait for the process to be completed.
  • ๐Ÿ”„ Reboot the device to activate the changes.

โ˜‘๏ธ Check before OTA

Done: 0 / 4

Manual installation of firmware through Recovery

If OTA-It didn't work, or you want to manually upgrade, and you'll need to use Recovery, which is more reliable because you can control every step of the process. You'll need a full firmware archive in.zip.

Place the firmware file in the root of internal memory. Go into recovery mode by holding the key combination (usually Volume Up + Power). From the menu, select the language and press "Install Update Package".

Important: if you have a bootloader unlocked and you have a TWRP or other custom recovery installed, the process may be different. In standard MIUI Recovery, the installation may be blocked by an anti-rollback check, in which case the system will give an error "Can't verify update."

Type of firmwareMethod of installationData retentionRisk of Root loss
OTA (Package)Through settingsYes.High (requires manipulation)
Recovery (Full)Through Recovery.Yes.Tall (flies completely)
Fastboot (Full)Through PC and MiFlashNo (usually)Guaranteed fly off
Custom (Custom)Through TWRPDepends on Wipe.Requires reinstallation of Magisk

Once you install the firmware through Recovery, the superuser rights are guaranteed to be removed, as the boot partition will be replaced with stock.You will have to repaint the new boot.img from the downloaded firmware through the Magisk app on your computer or phone.

Update via Fastboot and MiFlash

Using Fastboot mode and MiFlash Tool on a PC is โ€œheavy artillery,โ€ a technique often used when a phone is โ€œburstโ€ or needs to change the firmware region. For Root-enabled devices, this is the most dangerous method, as it completely overwrites all partitions.

There are two types of firmware for Fastboot: Clear All and Lock/Save Data. To save data and partition structure with Root, it is important to choose the option without locking the bootloader. However, even when choosing the Save data option, the Root rules will be lost.

fastboot flash boot patched_boot.img


fastboot reboot

Above is a command that you can use after you have firmware through Fastboot to quickly reclaim access. First you flash the stock system, the phone reboots without Root, then you take boot.img from the used firmware, patch it into Magisk and stitch it back through Fastboot.

What to do if MiFlash makes a mistake?
If MiFlash gives an error when you are firmware with the bootloader unlocked, try selecting the "Clean all" option. "Missmatching image and device" error means that you are trying to flash firmware from another model or region, which is strictly forbidden.

Remember that firmware via Fastboot requires Qualcomm or MediaTek drivers installed, and ADB/Fastboot Without them, the computer will not see the smartphone in bootloader mode.

Recovery of Root Rights after Update

After a successful system update, regardless of the method you choose, you'll probably need to reactivate Magisk. If you upgraded through an OTA with pre-preparedness, just press the installation in the application. If you had a full firmware, the algorithm is more complicated.

You'll need a boot.img file that matches the version of the firmware that's currently installed, which can be extracted from the full firmware archive or pulled with ADB by adb pull /dev/block/bootdevice/by-name/boot boot.img (requires rights, so it's better to take it from the archive).

Open Magisk Manager and click โ€œInstallยป โ†’ ยซSelect and flash the file. Specify the path to the extracted file. boot.img. After the patch is completed, a file with a name like magisk_patched_xxxx.img It's going to be in the Download folder.

  • ๐Ÿ’ป Connect your phone to your PC in Fastboot mode.
  • โŒจ๏ธ Enter the command: fastboot flash boot magisk_patched_xxxx.img.
  • ๐Ÿ”„ Reboot the device with the command fastboot reboot.

โš ๏ธ Attention: Firmware incorrect boot.img (from another version of Android or kernel, will lead to Bootloop (cyclical reboot!

๐Ÿ’ก

Use the MagiskHide Props Config module if your banking apps or Netflix are no longer working after the update, which helps to hide the fact that Root is present and change your devices.

Possible problems and solutions

Modified systems often experience specific errors, including loss of broadband or VoLTE, which is due to the fact that modem and persist partitions can get lost or damaged when flashing.

Another problem is the failure of security applications (Google Pay, banking customers). Even if Magisk is installed, new versions of Google Play Services require a more subtle hidden setting. Use the "Configure DenyList" feature in Magisk settings.

If the phone went into the bootloom after trying to update:

1. Press the volume and power buttons to enter Recovery.

2. Try to make Wipe Cache (not to be confused with Wipe Data if you want to save a photo).

3. If it does not help - you will have to do a complete reset or flash through Fastboot with loss of data.

๐Ÿ’ก

The main rule of Xiaomi updates with Root is never to update blindly.Always have a complete archive of current working firmware on hand for possible rollbacks.

Also worth mentioning is the encryption problem: when you upgrade from Android 12 to Android 13/14, the encryption algorithm can change, and if you use old custom receptacles, they may not be able to work with the new encryption format, making it impossible to access data via TWRP.

Frequently Asked Questions (FAQ)

Will unlock the bootloader fly when you update?
No, the software update itself (OTA or Recovery) does not block the bootloader back, however, if you upgrade from Chinese firmware to Global through MiFlash with the "Clean all and lock" option, the bootloader will be blocked, which can lead to a brick if the regions do not match.
Do I need to remove Magisk before upgrading?
For OTA-It is advisable to temporarily โ€œdeleteโ€ Magisk through the application (the original file recovery function), update, and then flash the patch again.
Can I update if I have an Xposed Framework?
LSPosed or Xposed modules are deeply embedded in the system and must be removed before upgrading, otherwise there is a high risk of getting a bootloops immediately after rebooting.
What if the camera or sound is missing after the update?
Most likely, only system files have been updated, but drivers or configurations are still from the old version, or vice versa. Try to make a full Wipe Data. If it doesn't work, flash the full firmware version through Fastboot.
Is it safe to use automatic updates from Root?
No. Automatic updates on superuser-enabled devices are a lottery. Better to disable auto-update in MIUI settings and update manually, controlling the process and having recovery tools on hand.