Where SMS messages are stored on Xiaomi: file system analysis

Xiaomi smartphone users often face the need to save or migrate their correspondence history without realizing that standard copying methods are not always effective. Unlike photos or music, text messages do not lie as separate files in folders accessible through a regular file manager. They are a structured database, access to which is limited by the rights of the superuser to ensure the security of personal data.

Understanding where SMS is stored on Xiaomi becomes critical when screen failures, system failures, or a need to move to a new device. The standard /sdcard/ path won’t help here, as the Android operating system isolates application data. It requires either root rights or the use of an ADB debugging bridge, which allows you to bypass standard access restrictions.

In this article, we will take a closer look at the architecture of message storage, look at the physical location of database files, and suggest proven methods for retrieving them. You will learn why simple folder copying doesn't work, and you will get step-by-step instructions for a secure backup.

Message Storage Architecture in Android and MIUI

The Android operating system that underlies the MIUI and HyperOS shell uses a specific file system to store application data. Messages are not text documents that can be opened with a notebook. They are written into the SQLite database, which provides quick search, sorting and integrity of information even when the device suddenly shuts down.

Physically, this file is in a hidden partition of memory, which is designed for system data, and the path to it always begins with the root directory. /data/, This is something that is not readable to ordinary users without special rights, and it's done by Google developers specifically to protect against malware that could be code from banks or personal correspondence.

⚠️ Attention: Direct editing of the database system files can lead to complete inoperability of the message application or cyclical restart of the smartphone.

To access this area, you need to understand the difference between the internal memory of the user (/sdcard) and the system partition (/data). If you connect the phone to the computer in file transfer mode, you will only see the user area. System files are hidden from the user's eyes, which often causes confusion when searching for backups.

πŸ’‘

The system database of SMS is located in the secure /data/data/ section, access to which is possible only with root or ADB permissions.

The exact path to the message database file

If your Xiaomi smartphone has an unlocked Bootloader and superuser rights are set (e.g., via Magisk), you can access the file directly. The standard path to the messaging database is: /data/data/com.android.providers.telephony/databases/mmssms.db. This file contains the entire history of your correspondence.

The file name may vary slightly depending on the Android version and the shell installed. On some Xiaomi Redmi or Poco models with custom launchers, the path can lead to a specific application package if the standard is replaced by a third-party one.

To navigate the root file system, it is recommended to use specialized file managers such as Root Explorer or MT Manager. A regular conductor, even with root rights, may not display hidden system folders correctly. When working with a file mmssms.db, it is extremely important not to change its structure, but only to copy it.

  • πŸ“ The path to base: /data/data/com.android.providers.telephony/databases/
  • πŸ“„ File name: mmssms.db (main database) and mmssms.db-journal (temporary transaction log)
  • πŸ”’ Access: Requires activated Root access or work through ADB Shell
  • βš™οΈ Owner: The file belongs to the system and has access rights that prohibit reading by other applications

It is important to note that the mmssms.db-journal file is temporary and contains transaction data that has not yet been definitively recorded in the main database.

Methods of extracting SMS without Root rights through ADB

For most users, getting root rights to Xiaomi is a complex and risky process that can lead to a loss of warranty. Fortunately, there is a legal and secure way to access the database via a debugging bridge. ADB (Android Debug Bridge.This method does not require unlocking the bootloader, but requires enabling debugging mode by USB.

The first step is to activate the developer mode. To do this, go to Settings β†’ About Phone and quickly press 7 times on the MIUI Version (or OS Version). Once the notification "You became a developer" appears, you can go to the access settings.

β˜‘οΈ Preparation for work with ADB

Done: 0 / 4

Once you've connected to your computer and successfully authorized your device, you can use the command to back up the database.

adb pull /data/data/com.android.providers.telephony/databases/mmssms.db./sms_backup.db

However, on modern versions of Android (starting with 11 and above), direct access to /data/data/ folder via adb pull can be limited even with debugging rights, in which case the command will return the error "Permission denied". The solution is to use the adb backup command with the flag -noapk, which will create an archive of application data from which you can then extract the database.

If standard ADB methods are blocked by the manufacturer (which is common in MIUI 12/13/14), you can use the intermediate method through temporary granting of rights. To do this, ADB Shell runs a pm grant command that gives the console read rights, but this does not work on all versions of firmware without root.

Use of cloud services and local backup

Rather than digging into system files, most Xiaomi users prefer to use built-in backup mechanisms.This is the most reliable way to save data, since it guarantees the integrity of the database during recovery. Xiaomi offers several layers of data protection: local backup to the memory card and synchronization with the Mi Cloud.

Local backup creates a full picture of the status of the Messages application and saves it to a hidden folder on the internal drive.The path to these files is /MIUI/backup/AllBackup/. Inside you will find archives with a date of creation that can be copied to a computer. However, you can only restore them through the standard Xiaomi recovery menu, not just by transferring the database file.

Sync with Mi Cloud works on the principle of continuous updating. When you turn on the option, your SMS automatically loads to Xiaomi servers. This is convenient when you lose your phone, but raises questions about data privacy for some users. To activate, go to Settings β†’ Mi Account β†’ Mi Cloud β†’ Sync and select Messages.

⚠️ Note: When you restore from a local copy through the Recovery menu, all current messages on the phone will be replaced by data from the archive.

Where is the local copy of Mi Cloud stored on PC?
The Mi Cloud sync files on your computer are located on the C:\Program Files (x86)\MiCloudSync\UserData\[Your ID] path. However, they are encrypted containers, and it is impossible to extract text from the computer directly without using the official Mi Cloud client or the web interface.

Comparison of methods of correspondence preservation

The choice of method of saving depends on your technical skills and goals. If you just need to protect data from loss, the cloud or local backup will be perfect, but if the goal is to analyze correspondence, migrate to another OS or restore deleted messages, you will need to work with the database file.

Below is a table comparing the main methods available for Xiaomi devices:

MethodI need a Root.DifficultyReliabilityEditing capability
Direct copy of mmssms.dbYes.Tall.100%Maybe (via SQLite)
ADB Backup (backup)No.Medium95%Only after extraction
Local MIUI backupNo.Low.100%No (only restoration)
Synchronization of Mi CloudNo.Low.Depends on the network.No.

As you can see from the table, direct file access provides maximum flexibility, but requires high skill. Xiaomi local methods are reliable, but lock the user into the ecosystem, making it difficult to read text messages on a computer without a phone.

πŸ“Š What backup method do you use most often?
Mi Cloud
Local backup on the map
SMS Backup & Restore
I'm not doing a backup.

Recovery of deleted messages

Recovery of deleted SMS is a separate issue: If a message was deleted by a user, the record in the database is marked as free space, but the physical data can remain on the disk until it is overwritten. On Xiaomi smartphones with modern F2FS file system or EXT4 with TRIM function, the process of overwriting occurs very quickly, which reduces the chances of success.

The only way to work is to have a backup made before you delete it. Programs that promise to "deep scan" the phone's memory without root permissions are 99 percent fraudulent. They either show cache or they just generate random text. Real recovery is possible only from the file mmsms.db, saved previously.

If you have a copy of the database but the messages have been deleted recently, you can try using SQLite utilities like DB Browser for SQLite. Once you open the file, you can try to find deleted entries in free pages of the database, although (the probability of success) is low without specialized knowledge.

πŸ’‘

To automatically and regularly save your SMS in readable format (XML/CSV), use the application "SMS Backup & Restore". It does not require root and allows you to easily transfer correspondence between Android and iPhone.

FAQ: Frequently Asked Questions

Can I find SMS in the Documents folder or Download on Xiaomi?
No, standard SMS is never stored in user folders like Documents, Download or MIUI as text files, but is stored exclusively in the system database /data/data/... If you find files there, it is likely manually exported copies or multimedia content of MMS.
Where are the MMS (photos and videos from the messages) stored?
Multimedia attachments (pictures, video, audio) from SMS/MMS are usually saved to the general gallery, the way to them is /storage/emulated/0/Pictures/Screenshots or /storage/emulated/0/DCIM, or to a special folder /storage/emulated/0/MMS. Unlike text, these files are available for viewing without root rights.
Will a factory reset reset my SMS?
Yes, a full Wipe data reset completely clears the /data/ partition where the message database is stored. After this procedure, it will be impossible to restore the SMS without a pre-created backup. Always back up before resetting.
How to transfer SMS from Xiaomi to iPhone?
Direct file transfer is not possible due to the different OS structure. Use the "Move to iOS" app when you first set up your iPhone. It will transmit messages over a temporary Wi-Fi network. If the phone is already set up, you will need to reset your iPhone or use paid third-party utilities on your PC.
Why is the file mmsms.db small, although there are many correspondence?
SQLite is very efficient at compressing text information, even tens of thousands of messages take only a few megabytes, and the file size may not decrease immediately after the message is deleted, since the SQLite tags the space as free, but does not physically trim the file (this is called "vacuum").