Have you ever wondered where all your contacts are physically stored on a Xiaomi smartphone? Unlike photos or documents that can be easily found in a gallery or file manager, the phone book is hidden deep in Android system folders. This is no wonder: contacts are critical data, and the operating system protects them from accidental deletion or change.
On Xiaomi devices with shell MIUI The path to a contact folder may be different from a pure Android, and access to it often requires additional rights. In this article, we will not only show the exact path to the contact database file, but also explain how to safely export, edit or restore it. You will learn why standard backup methods through Settings β Google β Backups arenβt always reliable, and what to do if contacts suddenly disappear after an update MIUI.
Itβs important to understand that working with system contact files requires caution. One wrong action can lead to the loss of all phone book entries, so weβll take a detailed look at every step from obtaining root rights (if necessary) to using alternative backup methods through Mi Account or third-party apps.
Where exactly are your contacts stored on Xiaomi: the way to the system database
All Xiaomi smartphones (including Redmi models, POCO and Black Shark phone book contacts are stored in the SQLite database with the name contacts2.db. This file is located in a secure system folder, access to which is limited even for a user with developer rights.
The exact path to the file:
/data/data/com.android.providers.contacts/databases/contacts2.dbWhat is important to know about this path:
- π folder /data/data/ β This is an isolated application store. Each application has a directory with a unique identifier (in this case, com.android.providers.contacts).
- π Access to this folder is possible only with root rights or through ADB (Android Debug Bridge with enabled debugging USB.
- π± On some firmware MIUI (The Chinese version may be slightly different, but contacts2.db The file may be called contacts.db or be in a subfolder. /databases/.
- π If you use a Google account to sync, the contacts are additionally duplicated in the cloud, but the local copy is still stored in that file.
A critical nuance for Xiaomi: starting with MIUI 12, The system uses folder virtualization, so even with root rights, the path can be displayed as a symbolic link. /data/user_de/0/com.android.providers.contacts/databases/.
How to access the folder with contacts: 3 working methods
Access to the file contacts2.db It requires you to bypass the limitations of Android, and let's look at all the different ways that we can do it, from the simplest to the most complex.
1. Through ADB (rootless)
If your Xiaomi has enabled debugging on USB, You can copy the contact file through ADB:
adb pull /data/data/com.android.providers.contacts/databases/contacts2.db C:\backup\However, this method does not work on all versions. MIUI β Since Android 11, Google has tightened the rules for accessing app data.
2. Through root rights
If you have Magisk or another root access manager installed, use any root-enabled file manager (such as Root Explorer or Solid Explorer).
Attention: when copying a database file contacts2.db Please stop the process of com.android.providers.contacts through ADB Task Manager or the file may be damaged.
3. Through backup MIUI
The safest way is to use the built-in backup function MIUI:
- Go to Settings β About Phone β Backup and Reset β Local Backup.
- Select Contacts and create a backup.
- The backup file will be saved to /MIUI/backup/AllBackup/.
This file has the.bak extension and contains encrypted data, but it can be restored through the same settings section.
Check the available space on the device (minimum 50 MB)
Enable debugging over USB in the developer settings
Make sure the battery is more than 50% charged.
Turn off sync with Google for copy time (optional)-->
File structure contacts2.db: What's inside the contact database
File. contacts2.db β It's a SQLite database that contains several tables:
| Title of the table | Description | Key fields |
|---|---|---|
| raw_contacts | Provides basic information about each contact (ID, name, account) | _id, display_name, account_name, account_type |
| data | Stores all contact details (phone numbers, email, addresses) | raw_contact_id, mimetype, data1, data2 |
| phone_lookup | Index for quick search by phone number | normalized_number, raw_contact_id |
| groups | Information on contact groups | _id, title, account_name |
To view the contents of the database, you can use programs like DB Browser for SQLite or SQLiteStudio. However, editing the file directly is not recommended - this can lead to data corruption.
If you need to extract contacts in a readable format, it is better to export them through standard Android tools:
- Open the Contacts app.
- Click on three dots in the upper right corner β "Contact management" β "Imports/Exports".
- Select Export to File and specify the format (usually.vcf).
π‘
If you often work with a contact database, create a separate account in the Contacts app specifically for test manipulations, which will avoid losing real data during experiments.
What to do if contacts are lost: recovery from the system folder
If the contact is Suddenly disappeared after a MIUI update or factory reset, you can try restoring them from the system folder. Hereβs how:
Option 1: Restore from a local MIUI backup
- π± Go to Settings β About phone β Backup & reset β Local backups.
- π Select the backup file containing contacts (check the creation date).
- π Tap "Restore" and confirm the action.
Option 2: Manual recovery via ADB (if you have a backup of contacts2.db)
adb push C:\backup\contacts2.db /data/data/com.android.providers.contacts/databases/
adb shell chmod 660 /data/data/com.android.providers.contacts/databases/contacts2.db
adb shell chown system:system /data/data/com.android.providers.contacts/databases/contacts2.db
adb shell restartOption 3: Using Mi Account synchronization
If you previously enabled synchronization with Mi Account:
- Go to Settings β Mi Account.
- Check if the "Contacts" toggle is enabled.
- Tap "Sync now" and wait for the process to complete.
β οΈ Attention: If contacts disappeared after a MIUI update, do not create new contacts before recovery! The system may overwrite the old database with a new one, making recovery impossible.
Why contacts might disappear after a MIUI update
Alternative ways to back up contacts on Xiaomi (without root)
If you donβt want to deal with system folders, there are simpler and safer ways to back up your contacts:
1. Export to VCF file
The standard Android method:
- Open the "Contacts" app.
- Tap the three dots β "Manage contacts" β "Import/Export".
- Select "Export to storage" and choose the .vcf format.
- The file will be saved in the root of internal storage (usually named contacts.vcf).
2. Synchronization with Google
The most reliable method:
- π Go to Settings β Accounts β Google.
- π Enable synchronization for "Contacts".
- π± All contacts will be uploaded to your Google account and can be restored on any device.
3. Third-party apps
Popular apps for backing up contacts:
- π² Super Backup & Restore β allows backing up contacts, messages, and apps.
- π± My Contacts Backup β exports contacts to VCF or email.
- βοΈ Contacts+ β syncs with cloud services and creates backups.
Important: If you use third-party apps, check their permissions in Settings β Apps β Permissions to ensure they have access to contacts.
π‘
The safest backup method is combining Google synchronization with a local VCF export. This ensures you have both a cloud copy and a physical file.
Frequently asked questions about contacts on Xiaomi
Here are answers to the most common questions about working with the phonebook on Xiaomi devices:
Why donβt contacts sync with Google on my Xiaomi?
How to transfer contacts from Xiaomi to iPhone?
Can I edit the contacts2.db file directly?
Where are contacts stored if I use Dual Apps on Xiaomi?
How to recover contacts after a factory reset without a backup?
Security recommendations when working with the contacts database
Working with system files always carries risks. Follow these rules to avoid data loss:
- π Always create a backup before any manipulations with contacts2.db. Even viewing the file can sometimes lead to corruption.
- π‘οΈ Use reliable file managers with root support (e.g., FX File Explorer or Solid Explorer). Avoid unknown apps from unofficial sources.
- π If youβre editing the database, do it on a copy of the file, not the original.
- π΅ Disable automatic synchronization with Google or Mi Account while working with the database to avoid conflicts.
- π§ After manual changes, restart the device to ensure the system correctly reloads the contacts.
β οΈ Attention: On devices with MIUI 14+, Xiaomi introduced additional protection for system files. Attempting to modify contacts2.db without proper permissions may trigger the anti-tampering mechanism, leading to a bootloop. If youβre not experienced with ADB and root, itβs better to use standard backup methods.
If you regularly work with large contact databases (e.g., for business), consider using CRM systems like HubSpot or Zoho, which offer more reliable synchronization and backup tools than standard Android features.
Conclusion: Whatβs the best way to manage contacts on Xiaomi?
While knowing the location of the contacts database (/data/data/com.android.providers.contacts/databases/contacts2.db) can be useful in extreme cases, for most users, standard methods are sufficient:
- π Regular synchronization with Google or Mi Account β the simplest and most reliable way.
- π Periodic export to VCF β creates a physical copy that can be stored on a computer or cloud.
- π± Using third-party apps for advanced features (merging duplicates, bulk editing).
Accessing the system folder is only necessary in exceptional cases β for example, when recovering data after a failed update or if standard methods donβt work. Remember that Xiaomi regularly updates the security mechanisms in MIUI, so manual methods may stop working with new versions of the firmware.
If youβve lost contacts and none of the methods helped, contact Xiaomi Support with a detailed description of the problem. In some cases, they can restore data from server backups (if synchronization was enabled).