How to Unlock Xiaomi Without Losing Data: All the Techniques Work

Introduction: Why Standard Resetting Is Not Suitable

Forgot the password from Xiaomi and fear losing photos, correspondence or work files? Classic reset via Recovery erases everything β€” but this is not the only way out. 80% of the time, unlocking is possible without formatting internal memory, if you follow proven schemes.

The problem is compounded by the fact that MIUI connects the unlock to the Mi Account, and the pattern lock or PIN-The code can even block access to the recovery menu. We've compiled 5 current methods (including bypassing through the recovery menu). ADB, Fastboot and Hidden Features MIUI), which work on models from Redmi Note 10 to Xiaomi 14 Ultra with firmware MIUI 12–14.

Important: If the phone is enabled with Google FRP (Factory Reset Protection), some methods will require input from the last synchronized Google account, a restriction at the Android level, and it is more difficult to get around without data loss β€” but possible.

Method 1: Unblocking through Mi Account (official method)

The safest option is to use a tied Mi Account. It works even if you don't remember the password from the lock screen, but remember the data from the Mi Account. MIUI 11 and newer.

Instructions:

  • πŸ”Ή On the lock screen, tap Forgot your password? (or Forgot password).
  • πŸ”Ή Choose Unblock with Mi Account.
  • πŸ”Ή Enter. email/Phone and password from Mi Account.
  • πŸ”Ή Confirm the unlock through SMS or email (if two-factor authentication is enabled).

⚠️ Note: If the Mi Account was not linked to the phone before locking, this method will not work, and it is not available if the device was bought from hand and the previous owner did not untie his account.

Make sure your phone is connected to Wi-Fi/mobile network

Remember your email/phone and password from your Mi Account

Have access to mail or SMS for confirmation

Check if IMEI lock is enabled (relevant for stolen devices)

-->

Xiaomi modelSupport for unlocking through Mi AccountIs the Internet required?
Redmi Note 12 Pro+Yes.Yes (Wi-Fi/mobile data)
POCO F5Yes.Yes.
Xiaomi 13TYes.Yes.
Redmi 10A (MIUI 12.5)Yes, but it might be necessary. SMS-confirmationYes.
Xiaomi Mi 11 LiteYes.Yes.

Method 2: Password bypassing through ADB (for enabled debugging)

If the phone previously had USB debugging enabled (Settings β†’ About Phone β†’ MIUI β†’ 7 taps by build number β†’ For developers β†’ USB debugging), you can delete the file with the password via ADB.

Step-by-step:

  1. Connect your phone to your PC via USB (use the original cable!).
  2. Open the Command Prompt (Windows) or Terminal (macOS/Linux) in the folder with ADB.
  3. Enter the commands in order: adb devices (to display your device) adb shell su rm /data/system/gesture.key rm /data/system/password.key rm /data/system/locksettings.db rm /data/system/locksettings.db-wal rm /data/system/locksettings.db-shm reboot

Once rebooted, the password will be reset, and this method only works if the phone has root rights or has debugging enabled before locking.

πŸ’‘

If the su command doesn’t work, try rooting first through Magisk or temporary exploit (like DirtyCOW for older versions of Android).

⚠️ Attention: MIUI 14 with Android 13+ This method may not work because of the enhanced protection of system files, so try an alternative way:

adb shell am start -n com.android.settings/.ChooseLockGeneric

This command will call up a password change menu where you can sometimes set a new PIN without entering the old one.

Method 3: Reset password via Fastboot (without data loss)

If USB debugging is disabled but the bootloader is unlocked, you can use Fastboot to delete password files. This method is suitable for devices with an unlocked bootloader (checked by the fastboot oem device-info command - look for the Device unlocked: true line).

Instructions:

  1. Turn off the phone. Press the Power button + Volume down to enter the Fastboot.
  2. Connect the device to the PC and execute: fastboot devices (serial number should be displayed).
  3. Enter the command to temporarily mount the data section: fastboot boot twrp.img (where twrp.img is a custom recovery image for your model).
  4. In TWRP, go to Advanced β†’ File Manager and delete files: /data/system/gesture.key, /data/system/password.key, /data/system/locksettings.db*.
  5. Reboot the phone.
Where to download TWRP for Xiaomi?
Official TWRP builds for most Xiaomi models are available at twrp.me. Choose a version strictly for your model (e.g. Redmi Note 11 Pro+ 5G = vili). New devices (e.g. Xiaomi 14) may require an informal build from the XDA Developers forum.

⚠️ Note: If the bootloader is locked (Device unlocked: false), unlocking through the Mi Unlock Tool erases all data.

Unlocked (Device unlocked: true)

Device unlocked: false

I don't know how to check.

I'm a different brand.

-->

Method 4: Use Safe Mode (for third-party launchers)

If a third-party launcher is installed on the phone (e.g. Nova Launcher, Apex Launcher), you can try bypassing the lock via Safe Mode.This method works because all third-party applications, including some lock mechanisms, are disabled in Safe Mode.

How to activate Safe Mode:

  1. Turn off the phone.
  2. Press the Power Button before the Xiaomi logo appears, then release and immediately press Volume down, holding until the system boots.
  3. In the lower right corner of the screen will appear the inscription Safe mode.
  4. Try setting a new PIN/pattern lock through Settings β†’ Screen Lock.

If this method worked, after changing the password, it is necessary to:

  • πŸ”Ή Restart your phone in normal mode.
  • πŸ”Ή Remove third-party launchers (they may have caused a lock conflict).
  • πŸ”Ή Create a backup of data through Settings β†’ Additionally. β†’ Backup.

πŸ’‘

Safe Mode only works if the lock is implemented at the launcher level, not the system partition. On a pure MIUI without third-party shells, this method is useless.

Method 5: Google Find My Device (for Google accounts)

If you have a Google account attached to your phone and sync enabled, you can reset your password remotely via Find My Device, which doesn't require a PC connection, but only works when you have an active Internet connection on your phone.

Instructions:

  1. Go to Find My Device from another device.
  2. Select a blocked Xiaomi from the list of devices.
  3. Press Device Lock.
  4. Enter a new password (it will replace the old one after synchronization).
  5. Confirm the action.

⚠️ Note: After resetting your password through Find My Device, you may need to re-authorize some applications (e.g. WhatsApp, banking apps) and this method will not work if you don’t have a password reset:

  • πŸ”Ή Google Play Services are disabled on the phone.
  • πŸ”Ή The device is not connected to the Internet.
  • πŸ”Ή Google Accounts Have Been Deleted or Changed After Blocking.

What to do if nothing helps: extreme measures

If all of these methods fail, there are two options left – both lead to data loss, but differ in complexity:

  1. Hard reset via Recovery: πŸ”Ή Turn off the phone. β†’ clamp down on power. + Loudness up. πŸ”Ή Choose Wipe Data β†’ Wipe All Data. πŸ”Ή Confirm reset (deletes everything, including photos and apps).

Firmware via Mi Flash Tool

  • πŸ”Ή Download the official firmware for your model from the Xiaomi Firmware website.
  • πŸ”Ή Install the Mi Flash Tool on PC.
  • πŸ”Ή Connect your phone in Fastboot mode and run a clean version MIUI.

⚠️ Note: After a hard reset on devices with MIUI 13+ Maybe the lockdown will work. FRP (Factory Reset Protection: Unlocking will require you to enter data from the last synchronized Google account, and if you don’t remember it, the phone will turn into a brickΒ».

πŸ’‘

Before reset, remove the memory card (if any) – the data on it will not be affected, and check if the photos are saved in Google Photos or Mi Cloud (sometimes sync works even on a locked phone).

FAQ: Frequent questions about unlocking Xiaomi

Can you unlock Xiaomi without losing data if USB debugging is disabled?
Yes, but only if: πŸ”Ή You have unlocked Bootloader (you can check through fastboot oem device-info). πŸ”Ή The phone is linked to a Mi or Google account. πŸ”Ή It uses a third-party launcher, and if you don't have any of these, you just have to reset with the loss of data.
Why does the phone ask for an old password after resetting through Mi Account?
This happens if: πŸ”Ή The phone has two-step lock enabled (PIN + print/face). πŸ”Ή Mi's account was not confirmed through SMS/email. πŸ”Ή The device is linked to a corporate account (e.g., through Android Enterprise) Solution: Try resetting your password through Find My Device or contact Xiaomi support (purchase confirmation will be required).
How to unlock Xiaomi if you forget your password and Mi Account?
Options: If the phone was officially purchased, contact Xiaomi Service Center with a check. IMEI (fee, ~1500–3000 β‚½). If you have access to a PC that your phone has synced to, try extracting data through the phone. ADB For models up to 2020 (like the Redmi Note 7), exploits like DirtyCOW sometimes help, but they require technical skills.
Does unlocking work through the engineering menu (#4636##)?
No. The engineering menu (#4636##) does not contain features for resetting the lock password, it is designed to test the network, battery and sensors. All the "instructions" on the Internet promising to unlock through this menu are frauds.
Can I recover data after resetting through Recovery?
Partially. If the phone was encrypted (default on the phone) MIUI 12+), You can't recover the data after the reset. If you didn't have encryption, try it: πŸ”Ή Programs like DiskDigger or EaseUS MobiSaver (scan internal memory at a low level). πŸ”Ή Contact the data recovery laboratory (cost from 5000) β‚½, Success is not guaranteed). ⚠️ Do not write new data to your phone after a reset – this reduces the chances of recovery!