Forgot the pattern lock on Xiaomi Redmi 7: how to unlock your phone without losing data

The forgotten pattern lock on Xiaomi Redmi 7 is a situation that many users face, especially when the phone stores important data, such as photos, contacts or work documents. Fortunately, there are several proven ways to regain access to the device, from simple to technically complex.

In this article, we will discuss all the current methods of unlocking without loss of data (if possible) and with a complete reset (if there are no other options left).It is important to understand that the effectiveness of each method depends on the version of MIUI, the status of the Mi Account and the availability of debugging over USB. Some methods require preliminary preparation, for example, linking the device to a Xiaomi account or enabling the developer mode.

If you have never set up additional ways to unlock (PIN-You don't have a Mi Account, you don't have a code, you don't have a fingerprint, you don't have a chance of getting around the pattern lock without resetting it, but don't despair, even then, there are working solutions.

1 Unlocking through Mi Account (official method)

The most reliable and recommended method Xiaomi uses is a tied Mi Account, which works if:

  • πŸ”Ή The phone is connected to the Internet (Wi-Fi or mobile data)
  • πŸ”Ή Remember the username and password from the Mi Account
  • πŸ”Ή The device is not disabled function "Find the device"

After 5 failed attempts to enter the pattern lock, the button Forgot the password? (or Forgot pattern?) will appear on the screen.

  1. Enter the email or phone number associated with the Mi Account.
  2. Confirm the login via SMS or email (depending on your account settings).
  3. Create a new pattern lock or PIN-code.

If the Forgot Password button doesn’t appear, try connecting your phone to charge and try again after 30 minutes – sometimes the system takes time to activate the recovery function.

⚠️ Note: If two-factor authentication is enabled on the device (2FA), You'll need a backup email or Mi Security app, and it'll be harder to restore your account without access to it.

πŸ’‘

If you do not remember the password from Mi Account, try to restore it through the official account.xiaomi.com website from another device. Use the backup email or phone number provided during registration.

2.Use of Recovery Mode (Reset to Factory Settings)

If Mi Account is not tied or you don't remember the login details, the radical method is hard reset via Recovery, which will delete all data from the phone, including photos, apps and settings, but will return access to the device.

Instructions for Xiaomi Redmi 7:

  1. Turn off the phone with a long press of the power button.
  2. Press the Volume Up (+) and Power button for 10-15 seconds at the same time until the Mi logo appears.
  3. Release the buttons and you will be taken to the Recovery Mode menu (may be in Chinese or English).
  4. Use volume buttons for navigation and power button to select the item.
  5. Select Wipe Data β†’ Wipe All Data (or similar).
  6. Confirm the reset, wait for the process to complete and restart the phone (Reboot).

Once rebooted, the device will be as new as it needs to be set up initially, and this method works at 100%, but all data will be permanently deleted.

What to do if you recover in Chinese?
If the Recovery menu is displayed in Chinese, look for the characters (clear data) and (reset) and the order of action remains the same: first reset, then reboot.
Unlocking methodConditions requiredData securityDifficulty
Mi AccountLinked account, Internetβœ… Preserve.⭐⭐
Recovery (dumping)No demands.❌ Removed⭐
ADB (USB debugging)Enabled debugging prior to lockdownβœ… Preserve.⭐⭐⭐⭐
Fastboot (firmware)Unlocked loader❌ Removed⭐⭐⭐⭐⭐

3. Unlock via ADB (if USB debugging is enabled)

If you activated the developer mode before blocking and enabled USB Debugging, you can delete the pattern lock file through your computer, which saves all the data but requires technical skills.

Step-by-step:

  1. Connect Redmi 7 to your PC via USB-cable.
  2. Open the command line (Windows) or the terminal (Mac/Linux) and type:
adb shell


su




rm /data/system/gesture.key




rm /data/system/locksettings.db




rm /data/system/locksettings.db-wal




rm /data/system/locksettings.db-shm




reboot

If the su command doesn’t work (no root rights), try an alternative method:

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

Once the phone is rebooted, it will prompt you to specify a new pattern lock, a method that doesn’t work on all versions of MIUI, as Xiaomi tightens protection with each update.

⚠️ Note: If the phone is enabled with data encryption (File-Based Encryption, FBE), deletion of key files through ADB It will cause you to lose access to all the data after you reboot it, and then you can only reset it completely.

Install ADB-PC-driver|Download the Android platform SDK Tools|Enable debugging on USB on the phone (if you had access)|Connect your phone to your PC in file transfer mode-->

4. Firmware via Fastboot (for power users)

If previous methods didn’t work and data isn’t important, you can reflash your phone via Fastboot mode, which is suitable for Redmi 7 with bootloader unlocked. If the bootloader is locked, you will need official permission from Xiaomi to unlock.

Instructions:

  1. Download the official firmware for Redmi 7 (for example, from MIUI Download).
  2. Unpack the archive with the firmware in the folder with fastboot.
  3. Turn off the phone and press Volume Down (-) + Power button to log into Fastboot Mode.
  4. Connect your phone to your PC and do the following at the terminal:
fastboot flash all name file firmware.img


fastboot reboot

It takes 5 to 10 minutes. Once you reboot, it's got a clean firmware, no pattern lock, and it's guaranteed to work, but it requires an unlocked bootloader.

Yeah, I unlocked it myself.|Yes, but with the help of a master.|No, I was afraid to break my phone.|I didn't know it was possible.-->

5. Alternative methods (without warranties)

If standard methods do not help, you can try less reliable, but sometimes working options:

  • πŸ“ž Calling a locked phone: Call your number from another phone, take a call, and try to open settings or notifications while you're talking. MIUI This allowed to bypass the lock (worked until 2020).
  • πŸ”Œ Connecting the mouse to OTG: If support is enabled in the settings OTG, plug in USB-Sometimes the cursor allows you to interact with the interface without locking.
  • πŸ› οΈ Service centers: Official Xiaomi services can unlock the phone on the purchase documents (check or warranty card.

These methods do not guarantee results, as Xiaomi regularly closes such "shooks" in security updates, for example, a vulnerability with a call was fixed in MIUI 12 and later.

πŸ’‘

If you bought your phone by hand, it's almost impossible to restore access without resetting, and in this case, the only reliable way is to run the firmware through Fastboot or access the service.

6.How to avoid blocking in the future

To avoid the problem of a forgotten pattern lock again, follow the simple recommendations:

  • πŸ” Link Mi Account to your phone and enable Find Device".
  • πŸ“± Set up a backup. PIN-code or fingerprint in settings β†’ Screen locking.
  • ☁️ Regularly back up important data through MIUI Backup or Google Drive.
  • πŸ”§ Turn on Debugging. USB Developer’s Settings (in case of future problems).

It is also useful to write the pattern lock in a safe place, such as in the password manager (KeePass, 1Password) or on paper. Avoid too complex patterns that are easy to forget.

If you often forget passwords, consider alternative ways to unlock: a face scanner (Face Unlock) or a dynamic password (Smart Lock), which disables locking in trusted places (for example, at home).

FAQ: Frequent questions about unlocking Redmi 7

Can I unlock Redmi 7 without losing data if my Mi Account is not tied?
Theoretically, yes, but only if USB Debugging was enabled before the lock and you can use ADB. Otherwise, data security is not guaranteed. On newer versions of MIUI (13+), even ADB may not work due to enhanced protection.
What if after resetting via Recovery, the phone requires an old pattern lock?
This is a well-known problem on some Xiaomi firmware. Solution: Log in to Recovery again. Select Wipe Data β†’ Format Data. Reboot your phone. If it doesn't work, run the device through Fastboot.
Can I unlock Redmi 7 with service codes (##)?
No, service codes (e.g. #4636##) are not going to help reset the pattern lock, they are for diagnostics, not for bypassing lockdowns, and using "secret" codes from the Internet can cause a system to crash.
How much does it cost to unlock in the Xiaomi service center?
The cost depends on the city and the status of the service: Official service: 1000-2000 rubles (with a guarantee); informal workshops: 500-1500 rubles (the risk of data loss is higher); To unlock you will need a check or a warranty card confirming ownership.
Can I recover data after resetting through Recovery?
If you have backed up your phone to Mi Cloud or Google Account, some of the data (contacts, photos, notes) can be restored after you log in. To recover files (music, documents) you will need specialized programs like Dr.Fone or EaseUS MobiSaver, but the chances are small – MIUI uses encryption.