How to flash Xiaomi Redmi 7: official and custom firmware

Xiaomi Redmi 7 (codenamed onc) is still a popular budget device, but over time its performance may fall due to outdated software. The firmware helps not only update the system to the current version, but also eliminate bugs, improve autonomy or even install custom firmware with advanced features. However, the process has nuances, from unlocking the bootloader to choosing the right version of MIUI for your modification (Redmi 7, Redmi 7A or global / Chinese version).

In this article, you will find 3 proven ways to run firmware through Recovery, Fastboot and Mi Flash Tool, as well as instructions for unlocking the bootloader and solving common errors (such as anti-rollback or invalid image). We will discuss how to avoid losing IMEI after firmware - one of the most common problems for Redmi 7 users when switching to custom builds. If you are a beginner, start with the official firmware through Recovery; experienced users can immediately go to the sections on TWRP and custom ROM.

Preparation for firmware: what to do before the start

Unprepared firmware can turn a smartphone into a brick. The first and most important thing is to save all the data. Even if you plan to scroll through Recovery without resetting, back up:

  • πŸ“± Contact and SMS: Sync with Google Account or export through Settings β†’ System system β†’ Backup.
  • πŸ“· Photo/video: copy to PC or cloud (Google Photos, Mi Cloud).
  • πŸ”‘ IMEI Serial number: write them down (you can find them in Settings) β†’ About the phone or the box).
  • πŸ”‹ Battery charge: at least 60% (when running through Fastboot, the phone should not turn off).

The second is to identify the current MIUI and the model. It's critical for Redmi 7 to know:

  • 🌍 Firmware region: global (MIUI Global), Chinese (MIUI China) or Indian (MIUI India. You can't mix them because of anti-rollback!
  • πŸ”’ Android: Redmi 7 was released with Android 9 Pie and updated to Android 11 (in unofficial firmware).
  • πŸ”“ bootloader status: blocked or unlocked (check by the command fastboot oem device-info).
πŸ“Š What kind of firmware do you plan to install?
Official MIUI
LineageOS (Pixel Experience)
Stock global
Another.

Third, download the necessary files:

Type of firmwareDownload linkNotes
Official MIUI (Recovery)Xiaomi websiteChoose the version for onc (Redmi 7)
Official MIUI (Fastboot)Xiaomi Firmware UpdaterFile in.tgz format
TWRP RecoveryOfficial website of TWRPVersion 3.7.0 or later
Custom firmwareXDA DevelopersPopular: Pixel Experience, LineageOS 18.1

⚠️ Note: If you are using Redmi 7 Chinese-made (MIUI China) global, be sure to check version compatibility.Switch from Android 9 Android 10/11 It may require an intermediate firmware due to anti-rollback protection.

Method 1: Firmware through Recovery (without unlocking the bootloader)

This is the safest method to use to update the current version of MIUI. It does not require unlocking the bootloader and saves user data (but better backup!).

  • πŸ”„ Updates to the new version MIUI within a single branch (e.g., with MIUI 12.5 on MIUI 13).
  • πŸ›  Correcting bugs with official patches.
  • πŸ“± Devices with locked loader.

Step-by-step:

  1. Download the firmware file in.zip format (for example, miui_ONCGlobal_V12.5.1.0.QFLMIXM_...).
  2. Rename the file to update.zip and move it to the root of the phone’s internal memory.
  3. Turn off the phone, then press Volume Up + Power to enter Recovery.
  4. Select the language (if you have a choice), then go to Install update.zip to System.
  5. Confirm the installation and wait for completion (5-10 minutes).
  6. After the reboot, check the version in Settings β†’ About the phone.

SHOWS official ZIP-file for Redmi 7 (onc)

The file is renamed to update.zip and is located at the root of the memory.

Battery Charge > 60%

Backup of important data is made-->

⚠️ Warning: If the phone is stuck on the Mi logo after the firmware, wait 15-20 minutes. If it doesn't work, go through Fastboot (method 2).

This method is not suitable for:

  • ❌ Transition from MIUI China MIUI Global (unblocking required).
  • ❌ Installation of custom firmware (required) TWRP).
  • ❌ downhreid MIUI (It can be used as an anti-rollback).

Method 2: Fastboot (Mi Flash Tool)

This method is suitable for complete flashing of the device, including recovery from the brick. It requires an unlocked bootloader and a PC with installed Xiaomi drivers.

  • πŸ”§ Ability to stream any version MIUI (including downgrade with caution).
  • πŸ›‘ Recovery of the phone after a failed firmware.
  • πŸ“¦ Installation of a β€œclean” system without residues of the previous firmware.

What you need:

  • πŸ’» Windows PC (7/10/11).
  • πŸ”Œ Cable USB Type-C (original or quality).
  • πŸ›  The Mi Flash Tool.
  • πŸ“„ Firmware in.tgz format (unpack it into a folder).

Instructions:

  1. Install the Mi Flash Tool and Xiaomi drivers (if the phone is not identified, use this driver pack).
  2. Turn off Redmi 7 and press Volume Down + Power to enter Fastboot (the rabbit logo in the cap).
  3. Connect your phone to your PC. In the Mi Flash Tool, press Select and specify the folder with the unpacked firmware.
  4. At the bottom, select firmware mode: Clean all – complete cleaning (recommended). Clean all and lock – cleaning + lock bootloader (only for official firmware!), Save user data – data storage (risky).

Flash

What to do if the Mi Flash Tool gives an error called "invalid image"
The error "invalid image" or "flash not done" usually occurs due to: 1. Incorrect firmware version (for example, trying to flash MIUI for Redmi 7A on Redmi 7). 2. Damaged firmware archive (pump and check checksum MD5). 3. Unlocked bootloader (for custom firmware). Solution: check the device code name (onc for Redmi 7) and repeat the process.

Possible errors and solutions:

Mistake.Reason.Decision
anti-rollback check failDowngrade attempt on older version of MIUISweep through the intermediate version or look for firmware with the anti-rollback disabled
device not foundDrivers are not installed or the cable is faultyReinstall the driver, try another one. USB-port
flash not doneIncompatible firmware or a corrupted fileCheck the firmware version and the integrity of the archive

Method 3: Install custom firmware through TWRP

Custom firmware (like LineageOS or Pixel Experience) gives Redmi 7 a new lease of life: up-to-date Android 12/13, no ads in MIUI, and advanced customizations.

  • πŸ”“ Unlocked loader (see section below).
  • πŸ›  Established TWRP Recovery.
  • 🧠 Understanding the risks (possible loss) IMEI, camera trouble).

Step-by-step:

  1. Unlock the bootloader (instructions in the next section).
  2. Install TWRP via Fastboot: fastboot flash recovery twrp-3.7.0-onc.img fastboot boot twrp-3.7.0-onc.img
  3. In TWRP, make a persist partition backup (important for saving IMEI!).
  4. Sweep through custom firmware: Erase the Dalvik, Cache, System, Data (except Internal Storage) partitions. Install ZIP-firmware file (e.g, lineage-18.1-20230510-onc.zip). Please use GApps (if you need Google services).

Reboot. The first launch can take 10 to 15 minutes.

πŸ’‘

Before installing custom firmware, check on the XDA forum to see if there are any bugs with the camera or mobile network. For example, some Pixel Experience builds for Redmi 7 do not have a wide-angle module.

Typical problems after installing custom firmware:

  • πŸ“Ά No network: check it out IMEI (If lost, restore it through the backup persist).
  • πŸ“· Camera not working: install the ANXCamera patch or check firmware compatibility.
  • πŸ”‹ Fast discharge: Calibrate the battery (discharge to 0%, charge to 100% without interruption).

How to unlock the bootloader on Redmi 7

Without unlocking the bootloader, you won’t be able to install TWRP or custom firmware. Xiaomi officially lets you unlock the bootloader, but the process requires a wait (usually 7-14 days).

Steps to unlock:

  1. Link your Mi Account to your phone: Go to Settings β†’ Mi Account and log in. Enable Sync and Device Search.
  • Download the Mi Unlock Tool.
  • Enter Fastboot (Loudness Down + Nutrition).
  • Connect your phone to your PC and start the Mi Unlock Tool.
  • Press Unlock – the program will request confirmation via SMS.
  • Wait 168 hours (7 days) and then repeat the process and the bootloader will be unlocked.

πŸ’‘

Unlocking the bootloader resets the phone to factory settings!

⚠️ Warning: If you see a "Couldn't unlock" error when unlocking, check: Mi Account is linked to your phone and confirmed by SMS. You use the original cable and port. USB 2.0 (not) USB The phone has debugging enabled. USB (Settings β†’ For developers).

IMEI Recovery After Firmware

Losing IMEI is the most common problem when running Redmi 7 firmware via Fastboot or installing custom ROMs. Without IMEI, the phone doesn't catch the network, and you can restore it in two ways:

Method 1: Through the backup of the persist partition (recommended)

  1. If you have backups in TWRP, restore the persist partition.
  2. Restart your phone and check it. IMEI In Settings β†’ The phone. β†’ Status. SIM-map.

Method 2: Manual recovery via QCN (for experienced)

  1. Download the QCN Rebuilder utility.
  2. Find the original IMEI (on the box or in the check).
  3. Create an IMEI.qcn file and run it through the QPST or Mi Flash Tool.
What if IMEI becomes "null/null"? That means that the nvram partition or persist partition is corrupted. Solutions
1. Restore the persist backup (if any). 2. Sweep the original MIUI through Fastboot with the Clean all and lock tick. 3. Contact the service center - they can restore the IMEI through the programmer.

Frequent Questions (FAQ)

Can I flash Redmi 7 without unlocking the bootloader?
Yes, but only official MIUI via Recovery (method 1).For custom firmware or firmware via Fastboot, unlocking is mandatory.
How do I know which firmware is on my Redmi 7?
Go to Settings β†’ About β†’ MIUI version. It will indicate, for example, MIUI Global 12.5.1 Stable (global version) or MIUI 13.0.4 China (Chinese version).
What to do if the phone does not turn on after the firmware?
Try: Hold Power + Volume up for 20 seconds (hard reset); Swipe again through Fastboot with Clean all tick; check if the battery is moving away (sometimes helps it pin).
Can I revert to an older version of MIUI?
Technically, yes, but very risky because of anti-rollback: If the new firmware has a higher anti-rollback number than the old one, the phone will lock.
Which custom firmware is better to choose for Redmi 7?
Popular options: Pixel Experience is pure Android with support for Google Camera. LineageOS 18.1 is stable build based on Android 11. Havent OS is optimized for weak devices. Before installing, check for XDA reviews - some firmware has bugs with a camera or mobile network.