Where Xiaomi stores SMS: file location, access and backup

Xiaomi smartphones (including the Redmi line and POCO) store SMS-It's not as easy to find them as normal photos or documents, unlike media files that are in a folder. DCIM Or Downloads, the messages are hidden in Android service directories, which are not available without special permissions. SMS How to view them without root rights, and why standard file managers donโ€™t show these files.

Complicating the problem is that MIUI (Xiaomi firmware) restricts access to system folders even through a Explorer. For example, if you connect your phone to a PC, you wonโ€™t see the SMS database folder in standard mode. However, there are workarounds, from using ADB to specialized backup applications. Weโ€™ll look at all the current ways, from the simplest to the most technically complex, and explain why remote SMS can only be restored for a limited time (before data is overwritten with new messages).

Where to store SMS on Xiaomi: The path to the database file

All right. SMS-Android messages (including Xiaomi) are stored in the mmssms.db database, which is located along the way:

/data/data/com.android.providers.telephony/databases/mmssms.db

This file contains not only the text of messages, but also metadata: sender number, date/time, status (read/unread) and even information about MMS. However, access to the /data/data/ folder is closed by default - it can only be viewed by:

  • ๐Ÿ” Root users (with smartphones with unlocked bootloader and superuser rights).
  • ๐Ÿ“ฑ System applications (e.g., Xiaomiโ€™s standard Messages app).
  • ๐Ÿ’ป ADB-teams (through debugging of the USB, but with limitations).

On Xiaomi devices with MIUI 12-14, the path remains the same, but the base structure may vary slightly depending on the firmware version. For example, in some MIUI builds for POCO F5 or Redmi Note 12, a file is called telephony.db and stores both SMS and call data.

๐Ÿ“Š What kind of smartphone you Xiaomi?
Redmi Note (any)
POCO (F/X/M series)
Mi (flagship)
Black Shark
Other

How to view SMS without root: 3 working ways

If you don't have root rights, you can't access the mmsms.db file directly.

1. Through the "Messages" and Export Application

Xiaomiโ€™s standard Messages app** allows you to export SMS to.xml or.txt:

  1. Open the Messages app.
  2. Tap it on three points (โ‹ฎ) โ†’ Settings โ†’ Additionally. โ†’ Export of communications.
  3. Select the dialogs for export and format (XML is recommended for backup).
  4. The file is saved in the MIUI/Backup/AllBackup folder.

2.Use of ADB (without root)

Using Android Debug Bridge (ADB) you can copy the SMS database to your computer:

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

However, this method only works if:

  • โœ… On the smartphone included debugging on USB (Settings โ†’ The phone. โ†’ Version. MIUI โ†’ 7 times to tap โ†’ Additional settings โ†’ Developer parameters).
  • โŒ You have not unlocked the bootloader (otherwise). ADB require confirmation of rights).

๐Ÿ’ก

If ADB issues a โ€œPermission deniedโ€ error, try running the adb shell first, then run-as com.android.providers.telephony cat databases/mmssms.db > /sdcard/mmssms.db. The file will appear in the root folder of internal memory.

3. Third-party backup applications

Applications like SMS Backup & Restore or Super Backup can back up SMS without root. They use the Android API to read messages and save them to the cloud or local file.

Install a backup app (e.g. SMS Backup & Restore)

Connect to Google Drive or another cloud service

Make sure your phone has enough free memory.

Turn off battery optimization for backup application-->

How to open the file mmsms.db: programs for viewing

Copying the database of mmssms.db (via ADB or root) will give you a binary file that cannot be opened as normal text.

ProgrammeTypeSupport for MIUIReference
DB Browser for SQLiteDesktop (Windows/macOS/Linux)Yes (opens mmsms.db)Official website
SQLite EditorAndroid appPartially (root needed)Google Play
SQLiteStudioDesktop (cross-platform)Yes (supports all MIUI tables)Official website

In the database mmssms.db SMS are stored in the table sms.

  • id is a unique identifier of the message.
  • Address โ€“ the phone number of the sender/recipient.
  • body SMS.
  • Timetamp (time in milliseconds since 1970)
  • Type - 1 (incoming), 2 (outgoing).
How to convert timestamp from the date field to readable format?
Timestamp in the date field is the number of milliseconds since January 1, 1970. To translate it to a normal date, use online services like Epoch Converter or the formula in Excel: =DATE(1970;1;1) + (timestamp/86400000)

Can I restore remote SMS on Xiaomi?

Deleted SMS does not disappear immediately, they are marked in the database as โ€œdeletedโ€ and stored until new data takes their place.

  • ๐Ÿ•’ Time: If more than a week has passed, the probability is close to zero.
  • ๐Ÿ“ฑ Phone Activity: The More New SMS The faster it gets, the older ones get rewritten.
  • ๐Ÿ”„ Optimization MIUI: Some firmware versions automatically clean up โ€œjunkโ€ data.

For recovery, you can use:

  1. Root applications like Undelete SMS (scan the database for deleted records).
  2. ADB-base dump teams (if) SMS Not yet rewritten).
  3. Backups (if you have previously done a backup through MIUI Backup or third-party utilities).

โš ๏ธ Warning: Do not install recovery apps SMS Many of them require root rights and may contain malicious code. The official Google Play Store blocks these programs, so they are often distributed through the Internet. APK-file.

Where does MIUI store backup SMS copies?

If you have ever used the Local Backup feature in MIUI, then SMS archives can be found along the way:

/MIUI/Backup/AllBackup/

Files are.bak and contain not only SMS, but also other data (contacts, notes, settings) to extract messages from them:

  1. Copy the *.bak file to your computer.
  2. Rename the extension to.zip and unpack the archive.
  3. Inside, there will be an SMS folder with a sms.xml or sms.db file.

For POCO and Redmi devices with MIUI 13/14, the path may be different:

/MIUI/Backup/{IMEI_devices}/

โš ๏ธ Attention: Backup copies MIUI If you reset your phone to the factory settings and you don't log in to the same account, you can't recover data from the backup.

๐Ÿ’ก

Local MIUI backups store SMS in encrypted form. Without linking to your Xiaomi account, you can not restore them - use third-party backup utilities if you plan to reset your phone.

Frequent errors when working with SMS on Xiaomi

Users often encounter problems when trying to find or copy SMS. Consider typical errors and their solutions:

Mistake.Reason.Decision
The file mmssms.db is not found on the standard path.In some versions of MIUI, the database is called telephony.db.Check the folder /data/data/com.android.providers.telephony/databases/ for alternative files
ADB issues Permission DeniedInsufficient rights or debugging over USB not enabledCheck the debugging status in Developer Settings and repeat the command with run-as
Backup app doesn't see SMSMIUI blocks access to messages for third-party programsAssign the application the role of โ€œDefault for SMSโ€ in the settings

Another common problem is that the SMS database is damaged, and this happens when you:

  • ๐Ÿ”Œ Unexpected power outage during recording of the message.
  • ๐Ÿ“‰ Critical battery charge level (below 5%).
  • ๐Ÿ”„ Failed update MIUI.

If the database is damaged, the Messages app may give an error Unfortunately, Messaging has stopped.

  1. Clean the app cache (Settings โ†’ Applications โ†’ Messages โ†’ Storage โ†’ Clear the cache).
  2. Delete the application data (will result in the loss of all SMS!).
  3. Restore from backup (if any).
Can I transfer SMS from one Xiaomi to another?
Yes, for this: On an old phone, export SMS to a.xml file via the Messages app or SMS Backup & Restore. Transfer the file to a new phone (e.g. via Xiaomi Cloud or USB cable). Import messages on a new device. If you use MIUI Backup, restore the backup via Settings โ†’ Memory โ†’ Backup.
Why did SMS disappear after resetting?
When hard reset (reset to factory settings), all data, including the base of mmssms.db, is deleted. SMS You can only do this if you have backed up through MIUI Backup or third-party utilities. Synced messages with your Google account (set up in the Messages app). SMS post-discharge.
How to save SMS to the cloud on Xiaomi?
MIUI does not support automatic SMS sync with the cloud, but there are workarounds: Use Google Messages (install from Google Play and enable sync with your Google account). Set up an automatic backup via SMS Backup & Restore in Google Drive or Dropbox. POCO/Redmi with MIUI 14 also has a backup option in Xiaomi Cloud, but it only saves SMS as part of the full system backup.
Can I read another personโ€™s SMS with his Xiaomi?
Not if you don't have physical access to an unlocked phone or backup. Even with a mmssms.db file, you'll need: Root access (to extract the base), password knowledge from a Xiaomi account (if the backup is encrypted). Any attempts to circumvent the security violate data privacy law.
Why donโ€™t you get SMS on Xiaomi?
The problem may be related to: Network settings: check that in Settings โ†’ SIM-maps and mobile networks โ†’ Name of the access point (APN) The correct parameters of the operator are indicated. MIUI There is a function of spam filtering (Messages). โ†’ Settings โ†’ Block and filter: Database error: clear the Messages cache (see section above).