How to change the system to Xiaomi: official and informal ways

Changing the operating system on Xiaomi smartphones is a task that may seem difficult for beginners, but with the right approach becomes quite feasible even for users with minimal technical experience. MIUI, But many owners want to install pure Android, custom firmware like LineageOS, or even experiment with alternative OSes. The reasons are different: from dissatisfaction with built-in advertising to the desire to get the latest security updates on older models.

Itโ€™s important to understand that the process of changing systems to Xiaomi is not just about clicking the โ€œUpdateโ€ button, it requires unlocking the bootloader, selecting compatible firmware, backing up data and sometimes even working with the command line. In this article, we will discuss all the steps from preparing the device to installing a new OS, and also consider the risks and ways to minimize them.

Device preparation: Backup and unlock the bootloader

Before you start changing your firmware, you need to save all the important data, even if you plan to "soft" flash without formatting the partition. /data, The risk of loss of information remains. Use official tools Xiaomi or third-party applications:

  • ๐Ÿ“ฑ Mi Cloud โ€“ syncs contacts, photos and notes (requires a Mi Account).
  • ๐Ÿ’พ Titanium Backup (for rooted devices) โ€“ saves applications and their data.
  • ๐Ÿ“ Swift Backup โ€“ alternative without root rights (partial reservation).
  • ๐Ÿ–ฅ๏ธ ADB pull โ€“ command utility for copying files to PC: adb pull /sdcard/ ~/Xiaomi_Backup/

The next critical step is to unlock the bootloader, which is locked by default on Xiaomi devices to protect against unauthorized changes.

  1. Linking your Mi Account to your device (require to confirm your email and phone!).
  2. Expectations are 7โ€“30 days after filing an application for unlocking (on new models, the period can reach 720 hours).
  3. Use the official utility Mi Unlock Tool (download only from the official website).

โš ๏ธ Warning: Unlocking the bootloader resets the device to factory settings. If you haven't made a backup at this stage, the data will be lost without the ability to recover.

๐Ÿ“Š What kind of firmware do you plan to install?
Official. MIUI (version)
Android (Pixel Experience, LineageOS)
Custom firmware (xXx, ArrowOS)
Other OS (Ubuntu Touch, Sailfish) OS)
I haven't decided yet.

Selection of firmware: official and custom options

Before you install a new system, you should decide on the type of system, and each option has its pros and cons:

Type of firmwareAdvantagesDeficienciesSuitable for
Official MIUI (Stable/Global)Maximum compatibility, OTA-Update and support all functionsAdvertising, regional version restrictions, slow updatesFor those who value stability
MIUI EU (unofficial)No Ads, Weekly Updates, Advanced SettingsNo. OTA, Possible bugs, requires an unlocked bootloaderAdvanced users who want clean MIUI
Pixel ExperienceClean Android, Quick Updates, Minimalist DesignBranded functions (IR-blaster, camera) may not workFans of "stock" Android
LineageOSLong-term support, open source, customizationComplex installation, possible performance problemsEnthusiasts, owners of old models

To select firmware, use resources:

  • ๐ŸŒ Xiaomi Firmware Updater โ€“ an archive of official and custom firmware.
  • ๐Ÿ“ฑ XDA Developers โ€“ a forum with discussions and instructions for specific models.
  • ๐Ÿ” Telegram channels (e.g, MIUI Russia) โ€“ current news and links.

Critical: Check firmware compatibility with your deviceโ€™s codename (e.g., raphael for Redmi) K20 Installing firmware for another model will result in a device "brick" (inoperability.

๐Ÿ’ก

Use the Droid Info app or the fastboot getvar product command to find out the code name of your smartphone.

How to install a new system: from Fastboot to TWRP

There are three main methods of changing firmware to Xiaomi, each of which is suitable for different scenarios:

1. via Fastboot (official method)

Suitable for installing official firmware MIUI (including the transition between the global and Chinese versions:

  • ๐Ÿ–ฅ๏ธ PC with installed drivers ADB/Fastboot.
  • ๐Ÿ“ฅ Firmware in.tgz or.zip format (unpacked in a folder).
  • ๐Ÿ”Œ Cable USB (preferably original).

Installation commands (executed from the firmware folder):

fastboot flash boot boot.img


fastboot flash recovery recovery.img




fastboot flash system system.img




fastboot flash vendor vendor.img




fastboot erase userdata




fastboot reboot

2. Through TWRP (squirrel)

Required for custom firmware installation (LineageOS, Pixel Experience, etc.)

  1. Install. TWRP Fastboot: Fastboot Flash Recovery twrp-3.7.0_9-0-raphael.img
  2. Getting into the Recavator: Fastboot boot twrp.img.
  3. Make a full backup (Backup option in the box) TWRP).
  4. Flip the firmware through Install, then Wipe โ†’ Format Data (required!).

3. via Mi Flash Tool (for "briques")

Used if the device is not turned on or stuck on the logo.

  • ๐Ÿ”ง Requires firmware in.tgz format for your model.
  • ๐Ÿ”„ Clean All Mode deletes all data, Clean All and Lock โ€“ additionally blocks the bootloader.
  • โš ๏ธ Don't interrupt the process! This could result in a complete loss of the device.

Download the firmware and check its hash sum|Install the drivers ADB/Fastboot|Unlock the loader|Backup in. TWRP|Disable signature verification in the Recaveri settings-->

Common mistakes and their solutions

Even when following instructions, users often face problems, and here are the most common ones and how to fix them:

Mistake.Reason.Decision
This device is locked in Mi FlashThe bootloader is not unlockedRepeat the unlocking procedure with the Mi Unlock Tool
The device is stuck on the MI logoIncompatible firmware or interrupted installationFastboot with the Clean All option
E: Unknown command [log] in TWRPAn outdated version of RecaveriUpdate TWRP to the latest version for your model
No network after firmwareNo modem or vendor availableSweep the files. modem.img and vendor.img separately

If the device overheats or discharges quickly after installing the new system, check:

  • ๐Ÿ”‹ Compatibility of the firmware with the version MIUI, which was previously established (e.g., the transition from MIUI 12 on MIUI 14 may require intermediate firmware).
  • ๐Ÿ“ก Correct operation of modem files (especially important for devices with Mediatek).
  • ๐Ÿ› ๏ธ Root rights or modifications that conflict with the core of the system.

โš ๏ธ Note: On devices with Mediatek chipsets (such as the Redmi Note 10 Series), custom firmware installation often leads to problems with the camera or Wi-Fi. Before firmware check the user reviews of your model on the Internet. XDA or 4PDA.

What if the sensor doesnโ€™t work after the firmware?
If the sensor stopped responding after installing the new system, the file incompatibility is likely a problem. dtbo.img Or vendor: 1. Return to the stock firmware via Fastboot. 2. Find an alternative firmware build marked "fixed touch". 3. Hand-stitch the correct one. dtbo.img Original Firmware: Fastboot Flash dtbo dtbo.img

Data recovery after system change

If you backed up before the firmware, it's not difficult to recover the data.

  • ๐Ÿ“‚ Files on internal memory (/sdcard/): When you format the userdata partition, they are deleted. Restore them from your PC or the cloud.
  • ๐Ÿ“ฑ Apps and their data: if you used Titanium Backup, restore backup TWRP (restore).
  • ๐Ÿ”‘ Accounts and passwords: sync through Google or Mi Account (if the firmware supports it).

For devices with unlocked bootloader and root rights, you can use Migrat, an application for transferring data between firmware, and it stores:

  • ๐Ÿ“ž Call logs and SMS.
  • ๐ŸŽต Application settings (including games).
  • ๐Ÿ“‹ Wi-Fi networks and passwords.

If there is no backup, try the data recovery software:

  • DiskDigger scans internal memory for deleted files.
  • Dr.Fone โ€“ Recovers contacts and messages (requires root).
  • PhotoRec is a console utility for deep scanning.

โš ๏ธ Note: On devices with a file system F2FS (for example, Poco F1) Standard data recovery methods often don't work, and only a pre-built backup will help.

๐Ÿ’ก

Always check the integrity of the backup before you run the firmware, and try to restore 1-2 files on a test device or emulator.

Alternative operating systems: Ubuntu Touch, Sailfish OS others

In addition to Android firmware, some Xiaomi devices can be installed alternative OS. This is true for enthusiasts or owners of older models who want to extend the life of the gadget.

Operating systemSupported modelsFeaturesComplexity of installation
Ubuntu TouchPoco F1, Redmi 4X, Mi A2Linux environment, PC convergence, no Google servicesMedium (requires) TWRP)
Sailfish OSXiaomi Mi 8, Redmi Note 7Guest management, support for Android applicationsHigh (needs a patch for the bootloader)
PostmarketOSRedmi Note 5, Mi 6Modular system, updates to 10+ yearsHigh (requires manual adjustment)

Installing alternative OS has a number of limitations:

  • ๐Ÿ“ต No modem support on some models (no calls)/SMS).
  • ๐ŸŽฎ No hardware graphics acceleration (game and video problems).
  • ๐Ÿ”‹ Fast battery discharge due to unoptimized core.

For experiments, we recommend using a second device or model with active community support (e.g. Poco). F1 or Mi A2). Instructions for installation, look for on the official sites of projects:

  • ๐ŸŒ Ubuntu Touch
  • ๐ŸŸ Sailfish OS
  • ๐Ÿ“ฆ PostmarketOS

Security and risks: how not to turn a smartphone into a brick

Changing the operating system to Xiaomi is a process that involves risks.

  • ๐Ÿงฑ "Brick (inoperable device) โ€“ occurs when a firmware is interrupted or incompatible files are used.
  • ๐Ÿ”’ Loss of warranty โ€“ unlocking the bootloader will void the official Xiaomi warranty.
  • ๐Ÿ›ก๏ธ Security vulnerabilities โ€“ custom firmware may contain backdoors (especially from unverified sources).

To minimize the risks, follow the following rules:

  1. Use only firmware from verified sources (XDA, official project sites).
  2. Check the hash sums (MD5/SHA-1) downloaded.
  3. Do not interrupt the firmware process (even if it is frozen - wait 10-15 minutes).
  4. Have an original cable and a charged battery (minimum 50%) on hand.

If the device has stopped turning on:

  • ๐Ÿ”Œ Try to download to Fastboot (Power) + Vol Down or Recovery (Power) + Vol Up).
  • ๐Ÿ–ฅ๏ธ Connect to your PC and check your response to commands: fastboot devices
  • ๐Ÿ“ก If the device is detected, run the stock firmware through the Mi Flash Tool in Clean All mode.

โš ๏ธ Note: On Qualcomm chipset devices (e.g. Redmi) K20 Pro) in the case of a โ€œbrickโ€ the regime may help EDL (Emergency Download Mode requires an authorized Xiaomi account and a Deep Flash Cable (Deep Flash Cable) to activate it).

๐Ÿ’ก

If you're not sure what you're doing, you can go to forums or power users for help. Most of the brilliance is recoverable, but the process may require special equipment.

FAQ: Answers to Frequent Questions

Can I return the official firmware after installing the custom?
Yes, it's possible, for a return to the stock shop. MIUI: Download the official firmware for your model from the site MIUI Unpack the archive and run through the Mi Flash Tool in Clean All mode. If the bootloader has been unlocked, it will remain in this state (re-blocking is possible only through the service center). After returning to the stock firmware, the device will undergo an anti-Rollback procedure, which can block the bootloader for 72 hours.
How do I know if my Xiaomi bootloader is unlocked?
There are two ways: Turn off the device and turn it on while holding the Power. + Vol Up. If you see the words Unlocked with an open lock, the bootloader is unlocked. Connect your smartphone to your PC and execute the command: fastboot oem device-info Search for the lines Device unlocked: true.
Why is the camera or fingerprint sensor not working after the firmware?
This is a typical problem when installing custom firmware, especially on devices with proprietary drivers (e.g., Redmi Note). 8 Pro with Mediatek Helio chipset G90T). Solutions: Install a special patch for the camera (look for the XDA - The device model. vendor.img and odm.img Use alternative camera applications (e.g. GCam) for a fingerprint sensor, try calibrating it in the security settings or scrub the file separately. persist.img.
Can I install custom firmware without unlocking the bootloader?
No, it's impossible. All modern Xiaomi devices (since 2016) have a locked bootloader that doesn't allow you to install unofficial software. The only exception is Mi A series devices (e.g. Mi). A2), They run on pure Android One and allow custom firmware to be installed without unlocking, but with no warranty. MIUI.
How often do you get custom firmware updates?
The frequency of updates depends on the project and device model: LineageOS: monthly security updates, new versions of Android - once a year. Pixel Experience: updates every 1-2 months, new versions - 3-6 months after the release of Google. MIUI EU: Ubuntu Touch: updates every 2-3 months, new OS versions every year. For older devices (for example, Redmi Note) 4X) Updates may be terminated 2-3 years after the release of the first build.