How to unlock Xiaomi if you forget your password without losing data in 2026

Forgetting the password from Xiaomi's smartphone is a frustrating situation, but it's not a hopeless one. The main problem most users have in this case is the fear of losing personal data: photos, correspondence, contacts or work documents. Standard tips from the Internet often suggest doing a hard reset through Recovery Mode, but it erases all information from the device. Fortunately, there are alternative methods of unlocking that allow you to keep files intact.

In this article, we will look at 5 proven ways to unlock Xiaomi (including the Redmi Note 12, POCO X5, Mi 11 and others) without losing data. It is important to understand that the effectiveness of the method depends on the version of MIUI, the presence of a linked Mi Account and the type of lock (PIN, pattern lock or fingerprint). Some solutions require preliminary preparation (for example, enabled debugging over USB), so if you read this in advance, remember preventive measures for the future.

1 Unlocking through Mi Account (official method)

The most reliable way to unlock if your phone has a Mi Account attached is to use the Find Device feature, which works even without first setting up the debugging over USB and does not require a computer connection, the main condition is that the phone must be connected to the Internet (via a mobile network or Wi-Fi).

Instructions:

  • 🌐 Go to i.mi.com and log in with the same account that is linked to a locked phone.
  • πŸ“ In the menu, select Find the device β†’ Your device (if the phone isn’t showing up, update the page or check your network connection on your smartphone).
  • πŸ”“ Click Unlock the device and confirm the action through SMS email.
  • ⏳ Wait 5-10 minutes – the phone unlocks automatically (may need to restart).

⚠️ Warning: If two-factor authentication is enabled on the phone, you will need access to a backup email or phone number.

This method works on all modern Xiaomi models (starting with MIUI 10), but there are nuances:

  • βœ… Suitable for unlocking. PIN-code, pattern lock and password.
  • ❌ It won’t work if your Mi Account wasn’t tied to your phone before being blocked.
  • ⚠️ On some firmware (for example, MIUI Global for European Regions: The function can be disabled by default.
πŸ“Š What type of lock you use on Xiaomi?
PIN-code
pattern lock
Password.
Fingerprint.
Face.

2. use ADB (if USB debugging is enabled)

If the phone had USB debugging enabled in advance (Settings β†’ About Phone β†’ MIUI Version β†’ 7 times press to unlock developer mode), then unlocking through ADB (Android Debug Bridge) is one of the most effective ways. It allows you to delete the password file without resetting data.

Step-by-step:

  1. Download and install ADB Tools on your computer (Windows, macOS or Linux).
  2. Connect your locked phone to your PC via USB-cable (use the original cable for a stable connection).
  3. Open the command prompt (cmd on Windows or Terminal on macOS/Linux) and type:
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

After restarting, the phone unlocks, but it may be necessary to re-configure the pattern lock or PIN-code.

Install ADB Tools on PC|Enable debugging on USB on the phone (in advance!)|Use the original USB-cable|Check the connection by command adb devices-->

⚠️ Note: New Xiaomi models (e.g. Redmi Note) 13 Pro+) Password files can be stored elsewhere. If the command doesn't work, try to delete them. /data/system/lock_pattern.autokey or /data/system/lockscreen.password_key.

Advantages of the method:

  • πŸ”§ No data reset required.
  • πŸ“± It works on most versions. MIUI (8-to-14).
  • ⚑ Fast execution (5-10 minutes).

Disadvantages:

  • πŸ”Œ Requires a pre-setting debugging for USB.
  • πŸ–₯️ Minimum command line skills required.

3. Unlock via TWRP (for stitched phones)

If your Xiaomi has customized TWRP recavators installed, unlocking without data loss becomes much easier, a method that is suitable for users who have previously installed informal firmware or modified the system.

Instructions:

  1. Turn off your phone and press the button combination to log in to Recovery Mode (usually Power + Volume Up).
  2. From the TWRP menu, select Advanced β†’ File Manager.
  3. Go to /data/system/ and delete files: gesture.key password.key locksettings.db locksettings.db-wal locksettings.db-shm

Reboot System

Xiaomi modelSupport for TWRPComplexity of installation
Redmi Note 10/11βœ… Yes.Medium
POCO F3/F4βœ… Yes.Low.
Mi 11 Ultra⚠️ Partially.Tall.
Redmi 9A/9Cβœ… Yes.Low.

If the TWRP is not installed, it can be flashed through the Fastboot, but this requires unlocking the bootloader, which will result in a complete data reset, so this method is only suitable for those who have already used custom firmware.

πŸ’‘

Before installing TWRP, back up the /data partition through the backup itself, which will save your data even if the firmware fails.

4. Bypassing locks via Safe Mode (for older versions of MIUI)

On phones with MIUI 8-11 (e.g. Redmi 4X, Mi A1), you can try to bypass the lock via Safe Mode, which does not work on all devices, but if you do, the data will remain intact.

How to do this:

  1. Press the power button to turn off the menu.
  2. Hold your finger on the option to turn off (or turn off power) until a request to switch to Safe Mode appears.
  3. Confirm the transition. The phone will restart in safe mode.
  4. In Safe Mode, try to install a new one. PIN-code or pattern lock through Settings β†’ Screen locking.
  5. Restart your phone in normal mode.

⚠️ Attention: On new versions MIUI 12+ This method does not work – Xiaomi developers have closed this vulnerability, and some features may be disabled in Safe Mode (for example, mobile Internet).

The following is the MIUI 10–11:

  • πŸ“ž Call the locked phone from another device.
  • πŸ“ž Take a call and try to open Settings during the conversation β†’ Screen locking.
  • πŸ”„ Change your password and reset your phone.
Why is Safe Mode not working on Xiaomi?
Starting with MIUI 12, Xiaomi has tightened security policies, with Safe Mode now blocking access to screen lock settings, and disabling features that could help bypass passwords, to protect user data from unauthorized access.

5 Unlocking through Xiaomi Service Centers

If none of these methods worked, the last option is to contact the official Xiaomi service center.This is a paid service, but it guarantees unlocking without loss of data (provided that the phone was not stolen or blocked at the request of law enforcement).

What will be required:

  • πŸ“„ Document confirming the purchase (check, warranty card or box with IMEI).
  • πŸ†” Passport of the holder (to confirm the identity).
  • πŸ“± The device itself with a charge of at least 30%.
TownThe cost of unlocking (β‚½)Time limit for implementation
Moscow1 500–2 5001-3 hours
St. Petersburg1 800–3 0001-2 days
ekaterinburg1 200–2 0001 day
Novosibirsk1 300–2 2002-4 hours

Advantages of using the service:

  • πŸ” Guaranteed unlocking without risk of damaging data.
  • πŸ› οΈ Diagnostics of the device for other malfunctions.
  • πŸ“ Official guarantee for the work performed.

⚠️ Warning: Don't go to informal workshops that promise to unlock "in 5 minutes." Often, these "specialists" use questionable methods (for example, flashing through the Internet). EDL), which may result in loss IMEI or the cell phone brick.

Prevention: How to avoid blocking in the future

To avoid the problem of forgotten passwords again, follow these tips:

  • πŸ”‘ Use a password manager (such as Bitwarden or KeePass) to store PIN-codes and graphic keys.
  • πŸ“± Link your Mi Account and enable data synchronization (Settings) β†’ Accounts. β†’ Mi Account β†’ Synchronization).
  • πŸ”§ Enable Smart Lock (Settings) β†’ Screen locking β†’ Smart Lock for automatic unlocking in secure locations (e.g. at home).
  • πŸ“§ Configure backup to Google Drive or Mi Cloud (Photos, Contacts, SMS).
  • πŸ”„ Regularly check the efficiency of debugging USB (Settings β†’ Additionally. β†’ For developers).

If you often forget passwords, consider alternative unlocking methods:

  • πŸ‘† Fingerprint (works even if you forget) PIN).
  • πŸ‘€ Facial recognition (on models with infrared camera, for example, Xiaomi 13 Pro).
  • πŸ“ Geofencing (automatic unlocking in certain locations).

πŸ’‘

The most reliable way to save data when you lock it is by linking your Mi Account and syncing enabled. Even if you forget your password, unlocking through i.mi.com will save all files.

FAQ: Frequent questions about unlocking Xiaomi

Can you unlock Xiaomi without losing data if USB debugging is not enabled?
Yes, but the choice of methods is limited. The most reliable options are: Unblock through Mi Account (if the account is tied), contact Xiaomi service center. Methods with ADB or TWRP without prior setting up will not work.
What to do if you forget your Mi Account password?
Restoring access through: πŸ“§ E-mail (link to reset the password will come to the email specified during registration). πŸ“ž SMS (if the phone number is attached). πŸ†” Documents (passport or purchase check) – you will need to contact Xiaomi. Without access to the account, unlocking via i.mi.com is impossible.
Does Google Find My Device work on Xiaomi?
Google's Find My Device feature allows only: πŸ“ Determine the location of the phone. πŸ”Š Activate the beep. 🧹 Wipe your data (full reset) Unlocking your screen through this service is not supported on Xiaomi.
Can I unlock Xiaomi through a computer without ADB?
Yes, but only if the phone has Remote Control enabled in Mi Cloud. For this: Sign in to i.mi.com. Select the device and use the Unlock option. If this feature is disabled, there are no alternatives without ADB or TWRP.
What happens if you enter your Xiaomi password 10 times wrong?
On most Xiaomi models after 10 failed attempts: πŸ”’ The phone will be locked for 5 minutes. πŸ“ž It will be impossible to receive incoming calls (except for emergency numbers). ⚠️ You will be asked to reset the device via Mi Account. on some firmware (for example, MIUI China) may require a standby PIN-code-key.