How to completely reinstall Xiaomi smartphone: from backup to clean firmware

Reinstallation of the operating system on Xiaomi smartphone is a procedure that can be necessary in a variety of situations, from banal interface brakes to critical failures after a failed update. MIUI allows you to return the device to "primordial purity", eliminate software conflicts and even upgrade to the current version if OTA-updates have stopped coming.

However, this process requires care: an error in unlocking the bootloader or selecting the wrong firmware can turn your Redmi, Poco or Mi into a brick. In this guide, we will break down all the official and informal ways to reinstall โ€“ from the safest (via Recovery) to the advanced (via Fastboot and other devices). ADB). We will pay special attention to the nuances that even experienced users do not mention: why some models require waiting 72 hours before unlocking, how to avoid an anti-rollback error, and what to do if the firmware is missing. IMEI.

We warn you right away that if your smartphone is warranty-free, reinstalling the software through informal methods can invalidate it. The official way (via the Mi Flash Tool) keeps the warranty, but requires unlocking the bootloader โ€” and this erases all data without the possibility of recovery. Are you ready for this? Then we'll get started.

Preparation for reinstallation: backup and method selection

The first and most important step is to save all critical data. MIUI, Especially through Fastboot, it formats the deviceโ€™s internal memory completely. Even if you plan to use the method through Recovery (which theoretically saves user files), the risk of data loss when you fail firmware is 98% โ€“ this is the statistics on forums. 4PDA XDA-Developers for 2023.

What exactly needs to be preserved:

  • ๐Ÿ“ฑ Contacts and Messages: Export through Settings โ†’ Google โ†’ Backup or applications like Super Backup.
  • ๐Ÿ“ท Photos and videos: Move to your PC or cloud (Google Photos, Mi Cloud).Please note that Mi Cloud may not save files in their original quality.
  • ๐Ÿ”‘ Logins and passwords: If you use a password manager (such as Bitwarden or built-in Mi Account), make sure the backup is synced.
  • ๐ŸŽฎ App data: For games (such as Genshin Impact or Honkai: Star Rail), use the link to your miHoYo or Google Play account.

Now, you'll have to figure out how to reinstall it.

MethodDifficultyDo you need to unlock the bootloader?Are the data stored?Suitable for
Recovery (through stock or custom recovery)โญNo.Partially (Data Loss Risk)Update of the current version MIUI, correction
Fastboot (via Mi Flash Tool)โญโญโญYes.No (full formatting)Change of firmware region, downgrade, recovery after failure
ADB SideloadโญโญNo (but access to Recovery is required)No.Install custom firmware (e.g. Pixel Experience)

If your goal is to simply return the smartphone to the factory state without changing the version MIUI, enough reset through Settings โ†’ The phone. โ†’ But if you want a full reinstallation with a firmware version, read on.

๐Ÿ“Š What Reinstallation Method Do You Plan to Use?
Through Recovery.
Fastboot (Mi Flash Tool)
Through ADB Sideload
I haven't decided yet.

2 Unlock the bootloader: why it can not do without it

The bootloader on Xiaomi smartphones is locked by default, a security measure that protects the device from unauthorized firmware changes, but for a complete reinstallation via Fastboot or custom Recovery installation (e.g., custom Recovery, TWRP) unlocking is mandatory.

The unlocking process includes several stages:

  1. Linking your device to your Mi Account (be sure to use the same account as your phone!)
  2. Submit an application for unlocking through the official Mi Unlock Tool application.
  3. Waiting for confirmation (72 hours to 15 days, depending on model and region)
  4. Directly unlock through Fastboot.

Important nuances:

  • ๐Ÿ”— Some models (e.g. Redmi Note 12 Pro)+ Xiaomi 13 Ultra unlocking may require additional code that comes to the email after approval of the application.
  • โณ If you previously unlocked the bootloader on this device, re-unblocking may be faster (sometimes immediately).
  • ๐Ÿšซ Anti-rollback devices cannot install firmware older than the current version. A list of models with this protection can be found on the official Xiaomi website.

Detailed instructions for unlocking:

  1. Download Mi Unlock Tool from the official website (version must match your OS: Windows) 10/11 x64).
  2. Turn on the smartphone Developer Mode (go to Settings) โ†’ About the phone and 7 times click on the version MIUI).
  3. In Settings โ†’ Additional โ†’ For developers, activate OEM-unlocking and debugging over USB.
  4. Connect your phone to your PC, launch the Mi Unlock Tool, and follow the instructions. During the device check phase, the phone will reboot to Fastboot.
  5. After successful unlocking, the inscription Unlocked will appear on the phone screen.
What happens if you break the unlock?
If you disconnect your phone from your PC or log out of the Mi Unlock Tool during the process, the bootloader may remain in a "semi-unlocked" state, in which case you have to repeat the procedure from the beginning, and the waiting time will reset. K50) After interruption, the phone may stop booting into the system, requiring forced firmware through the system. EDL-regime.

If the unlock fails, check:

  • ๐Ÿ”Œ Are you using the original? USB-cable (not all cables support data transfer to Fastboot).
  • ๐Ÿ–ฅ๏ธ Are Qualcomm or MediaTek drivers installed (depending on your smartphoneโ€™s processor).
  • ๐Ÿ“ฑ Is your Mi Account linked to your phone (check Settings) โ†’ Xiaomi account).

๐Ÿ’ก

If the Mi Unlock Tool is โ€œCouldnโ€™t unlockโ€ error, try using the 2022 version of the tool (v5.5.224.30). It often works more stable than new releases.

3. Selection of firmware: official vs custom

The choice of firmware depends not only on the functionality, but also on the stability of the device. Xiaomi offers several types of official firmware:

  • ๐ŸŒ Global Stable: stable version for the international market (supported by Google Services, but updated less often).
  • ๐Ÿ‡จ๐Ÿ‡ณ China Stable: Chinese version without Google, but with more frequent updates and some exclusive features.
  • ๐Ÿงช Beta/Developer: Test builds with new features but possible bugs.
  • ๐Ÿ“ฑ EEA (Europe: similar to Global, but with some regional restrictions.

Where to download the official firmware:

  • ๐Ÿ”— Official website: https://new.c.mi.com/global/miuidownload/index (Choose your own model!).
  • ๐Ÿ”— Community Xiaomi.eu: https://xiaomi.eu/community/ (Here are modified firmware with the remote Bloatware).
  • ๐Ÿ”— 4PDA: The forum has themes for each model with detailed instructions and alternative firmware.

If you decide to install custom firmware (such as LineageOS, Pixel Experience or ArrowOS), consider:

  • โš ๏ธ Custom firmware may not support all of your smartphoneโ€™s features (e.g, NFC wide-angle).
  • โš ๏ธ They will need to be installed. TWRP or other customized recovery.
  • โš ๏ธ Some banking applications (such as SberBank Online or Tinkoff) can block work on unofficial firmware.

How to check the compatibility of the firmware with your model:

  1. Find out the exact name of the model in Settings โ†’ The phone. โ†’ Model (e.g. Redmi Note 11 Pro) 5G โ€” It's veux, and Poco. X3 Pro โ€” vayu).
  2. Check the code name against the list of supported devices on the firmware site.
  3. Check the anti-rollback version (if any) โ€“ it can be found in the Fastboot command: fastboot getvar anti You can install only firmware with an equal or newer version of anti.

โ˜‘๏ธ Firmware preparation

Done: 0 / 4

4.Reinstall via Fastboot (Mi Flash Tool)

This is the most reliable way to completely reinstall MIUI, But it requires an unlocked bootloader and erases all the data:

  • ๐Ÿ”„ Recovery from the brick (if the phone doesnโ€™t turn on or gets stuck on the logo).
  • ๐ŸŒ Changes in the firmware region (for example, from Chinese to global).
  • โฌ‡๏ธ Downgrade on an older version MIUI (If anti-rollback allows).

Step-by-step:

  1. Download and install the Mi Flash Tool (the latest version can be found at xiaomiflashtool.com).
  2. Unpack the downloaded firmware (file with the extension.tgz or.zip) in a folder without Cyrillic characters on the way.
  3. Turn off the phone and press Volume Down + Power to log into the Fastboot.
  4. Connect your phone to your PC and run the Mi Flash Tool. The program must identify the device (if not, check the drivers).
  5. In the Mi Flash Tool, click Select and specify the path to the unpacked firmware.
  6. Select firmware mode: Clean all - full formatting (recommended). Clean all and lock - formatting + bootloader lock (use if you want to return the warranty) Save user data is an attempt to save data (does not always work correctly).

Flash

If the Mi Flash Tool is not correct,

Mistake.Reason.Decision
Couldn't find deviceDrivers are not installed or the cable is faultyInstall drivers manually through Device Manager or use the original cable
Flash not done, unknown errorIncompatible firmware or anti-recoil protectionCheck the anti-rollback version and download another firmware
Critical partition flashing is not allowedbootloader lockedUnlock the bootloader (see Section 2)

๐Ÿ’ก

If the phone doesn't turn on for more than 10 minutes after you've run through Fastboot, don't panic - the first download after a full reinstallation can take up to 20 minutes. If the screen remains black after that time, repeat the firmware with Clean all mode.

5. Reinstall via Recovery (without unlocking the bootloader)

This method is suitable if you want to update or reinstall the current version. MIUI So, minus -- you can't change the firmware region or install custom builds.

What you need:

  • ๐Ÿ“ฑ Smartphone with a battery charge of at least 50%.
  • ๐Ÿ’พ Firmware in.zip format (download from the official website, section Recovery) ROM).
  • ๐Ÿ”Œ USB-cable OTG-Driver (if you copy firmware directly to your phone).

Instructions:

  1. Copy the firmware file (.zip) into the root folder of the phone's internal memory (not nested!). update.zip convenienceally.
  2. Turn off the phone and press Volume Up + Power to enter Recovery.
  3. In the Recovery menu (navigation is done by volume buttons, the choice is by the power button), select a language (if there is such a item).
  4. Go to Install. update.zip to System (or similar item, depending on the version of Recovery).
  5. Confirm the installation and wait until the end (the phone will restart automatically).

If there is no installation point in Recovery update.zip, You have a customized recovery (for example, TWRP). In this case:

  1. Choose Install.
  2. Specify the path to the firmware file.
  3. Swipe for confirmation.
  4. After installation, run the Wipe โ†’ Format Data (this is mandatory, otherwise the system may not boot!).

๐Ÿ’ก

If after installing via Recovery, the phone is stuck on the boot, try resetting the cache: in Recovery, select Wipe โ†’ Wipe Cache. If that doesn't work, re-install the firmware.

Recovery after reinstallation: setup and verification

After successful reinstallation MIUI You're going to have to set up the system first:

1.Verification IMEI and serial number:

Sometimes, after the firmware through Fastboot disappears IMEI (Especially on models with MediaTek:

  • Please enter the phone app *#06# and it should be displayed. IMEI.
  • If IMEI No, restore it with the help of a tool. SN Write Tool (instructions are available on the 4PDA).

Configuration of region and language:

If you have a Chinese version MIUI, Russian language or Google Services may not be available:

  • Install Google Installer from the Mi App Store (for Chinese firmware).
  • Or stream the Global version through Fastboot (see Section 4).

Data recovery:

If you have backed up your copy through Mi Cloud or Google Account, restore it at the initial setup stage.

  • ๐Ÿ“ฑ Contacts and Messages: Import through Apps.
  • ๐Ÿ“ท Photos and videos: copy back from PC or cloud.
  • ๐ŸŽฎ Save games: log in to accounts (Google Play, miHoYo, etc.).

Verification of the operation of sensors and modules:

After reinstalling, test:

  • ๐Ÿ“ถ Network and Calls: Call another number, check your mobile internet.
  • ๐Ÿ“ท Cameras: Take a photo on the main and front camera.
  • ๐Ÿ”Š Speakers and microphone: record a voice message.
  • ๐Ÿ”‹ Charging: Connect the charger and make sure that charging is underway.
  • ๐Ÿ“ GPS Sensors: Enable geolocation and check in Google Maps.
What if the sensor doesnโ€™t work after the firmware?
If, after reinstallation, MIUI The sensor stopped responding to the touch, most likely, the firmware was not installed for your model. Solution: 1. MIUI via Fastboot (see section 4). 2. If the problem persists, check if the touchscreen plume is damaged (this is already a hardware malfunction). 3. On some models (for example, Redmi Note 10 Pro) resetting through the test menu helps: dial # #3646633## โ†’ Hardware Testing โ†’ Touch Screen Test โ†’ Calibrate.

7. Frequent errors and their solutions

Even with the exact following of the instructions, there can be problems.

This MIUI version cannot be installed on this device

Reason: Trying to install firmware with an older version of anti-rollback than the current one.

Decision:

  • Check the anti version with fastboot getvar anti.
  • Download the firmware with an equal or newer version.

Error: "Device is locked"

Reason: Trying to flash through Fastboot with a locked bootloader.

Solution: Unlock the bootloader (see Section 2).

Error: "Invalid image format"

Reason: corrupted firmware file or incorrect format.

Decision:

  • Download the firmware from the official website.
  • Check that the file is not corrupted (compare the hash amount with the one listed on the site).
  • If you are running through the Mi Flash Tool, make sure that the archive is unpacked correctly (there must be images and files). flash_all.bat).

Error: The phone does not turn on after the firmware

Causes and solutions:

  • ๐Ÿ”‹ Battery is dead: plug in to charge for 30 minutes, then try turning on.
  • ๐Ÿ”„ Wrong firmware: Sweep the correct version through Fastboot.
  • ๐Ÿ”ง The loader is damaged: try to sew through EDL-Mode (requires an authorized Xiaomi account and a special cable).

Error: No network after firmware

Causes and solutions:

  • ๐Ÿ“ถ The Wrong Firmware Region: Scroll the Version for Your Region.
  • ๐Ÿ”ง Damaged modem: run only modem and fsg partitions through Fastboot: fastboot flash modem modem.img fastboot flash fsg fsg.img
  • ๐Ÿ“ฑ No. IMEI: Restore it (see section 6).

๐Ÿ’ก

If, after reinstallation, MIUI The sound is gone in the speaker, but the headphones are working, most likely, the file is damaged. mixer_paths.xml. Solution: Sweat the original file from stock firmware through ADB or re-install MIUI without formatting the data partition.

FAQ: Answers to Frequent Questions

โ“ Can we re-install? MIUI data-free?
Theoretically yes, through recovery. update.zip), But it's not stable in practice, and we recommend you always back up, because even if you install it successfully, you can have errors in your applications.
โ“ How to know if the bootloader is unlocked on my Xiaomi?
Turn off your phone and press Volume Down + Power to log into Fastboot. If there's Unlocked at the bottom of the screen, the bootloader is unlocked. If Locked is locked.
โ“ Can I use Xiaomi on a Mac or Linux computer?
Yes, but the official Mi Flash Tool only works on Windows. Alternatives: Use fastboot manually through the terminal (the commands are the same as the instructions); Install Windows via Boot Camp (for Mac) or a virtual machine. For Linux, there are unofficial Mi Flash Tool ports, but they can run unstablely.
โ“ What to do if the phone overheats after the firmware?
Overheating after reinstallation MIUI This can be caused by: Incorrect firmware (e.g., stitched Global onto a Chinese model); background processes (after the first download, the system indexes files); damage to the thermopaste (if it was overheated before the firmware); Solution: run the correct version. MIUI and observe 1-2 If there's a problem, check the temperature through the AIDA64 (norm 40ยฐC in plain, until 60ยฐC under load).
โ“ How to return the guarantee after unlocking the bootloader?
Officially, no. But some service centers may close their eyes if you stitch the stock firmware and lock the bootloader back through the Mi Flash Tool (select Clean all and lock mode), but this does not guarantee a restoration of warranty, since the service menu remains traces of unlocking.