Have you ever wondered where your Xiaomi, Redmi, or POCO store all your phone contacts? Most users simply add numbers to their address book without thinking about how they are stored in the device's memory. Meanwhile, knowing the exact location of the contact files can come in handy in critical situations: when a phone is reset to factory settings, a device breaks down, or having to transfer data to another smartphone without using cloud services.
In this article, we will take a closer look at where Android contacts are physically stored on Xiaomi devices, how they are organized in the system, and what to do if you need to manually copy or restore the contact database (contacts2.db), And also how synchronization with Mi Account and Google affects the safety of your data. MIUI 12/13/14 and the nuances of working with root rights.
Physical location of contacts in Xiaomi memory: the way to the database
All contacts on Xiaomi smartphones (as well as other Android devices) are stored in a special SQLite database called contacts2.db. This file is in a secure system folder, access to which is limited without root rights. However, knowing the exact path will help when backing up through ADB or file manager with root access.
The main paths to the contact file:
- π For Android. 10 newer (MIUI 12/13/14): /data/data/com.android.providers.contacts/databases/contacts2.db
- π For older versions of Android (before) 9 inclusively): /data/com.android.providers.contacts/databases/contacts2.db
- π Backup copies MIUI: /MIUI/backup/AllBackup/ (if automatic reservation is enabled)
It is important to understand that the file contacts2.db It contains not only phone numbers, but also all the related information: names, email addresses, birthdays, tied social media accounts and even call history (in some versions). MIUI). The size of this file can range from a few kilobytes to tens of megabytes depending on the number of records.
β οΈ Attention: Direct file editing contacts2.db Without specialized tools (e.g., SQLite Editor) can cause database damage and loss of all contacts!
How to access a contact file without root rights
If your Xiaomi doesnβt have root access, there are a few legal ways to extract a contact file:
- Through ADB (Android Debug Bridge: Connect your phone to your PC, enable Debugging USB in the developer settings (Settings) β The phone. β Version. MIUI β slip 7 once) and execute the command: adb pull /data/data/com.android.providers.contacts/databases/contacts2.db If a permission denied error occurs, root rights are required.
- Export via Contacts: Open the standard Contacts app, click on three dots in the top right corner β Contact Management β Import/Export β Export to file. The system will create a.vcf (vCard) file in the Download folder.
- Use MIUI Backup: Go to Settings β Additional β Backup and Reset β Local Backup. Select Contacts and create a backup. The file will be saved to /MIUI/backup/AllBackup/.
It is worth noting that exporting to.vcf does not store all meta-information (for example, call history or account attachment), but it is universal and compatible with any device. contacts2.db, Contains complete data but requires special programs to view (e.g, DB Browser for SQLite).
Contact Sync: Mi Account vs Google vs Local Storage
On Xiaomi smartphones, contacts can be stored in three main repositories:
| Storage type | Where data is physically stored | Pluses | Cons |
|---|---|---|---|
| Locally (on the phone) | /data/data/com.android.providers.contacts/databases/contacts2.db | It is not dependent on the Internet, full control over data. | Risk of loss when a phone is dropped or broken |
| MI Account (Xiaomi Cloud) | Xiaomi servers (China/Singapore/Russia) | Automatic sync, access from any Xiaomi device | Limited space (5GB free), possible synchronization delays |
| Google Contacts | Google Servers (USA/EU) | Cross-platform, integration with Gmail, reliability | Google account required, possible problems with Chinese firmware MIUI |
Xiaomi offers to sync contacts with Mi Account by default, but you can choose Google or leave them on your device only.
- Open Settings β Accounts and Synchronization.
- Choose Mi Account or Google.
- Make sure the switch opposite the Contact is active.
β οΈ Note: If you use Xiaomi with global firmware (e.g. Redmi Note 12 Global) but are registered in the Chinese region of Mi Account, contact synchronization may not work smoothly due to regional restrictions.
Manual backup of contacts: step-by-step instructions
If you donβt trust cloud services or want to have full control of your data, manually back up:
Make sure your phone is at least 50 percent charged | Connect your device to a stable Wi-Fi network | Free up space (at least 50MB) | Turn off sync with Mi Account/Google while you're backup-->
Method 1: Using MIUI Backup (without root)
- Go to Settings β Additional β Backup and Reset β Local Backup.
- Click Backup and select Contacts (Call Log and Messages can also be added).
- Wait until the process is complete. The backup file will be saved to /MIUI/backup/AllBackup/.
- Copy the AllBackup folder to your PC or cloud for reliability.
Method 2: Export to VCF (Universal Format)
- Open the Contacts app.
- Click on three points β Contact Management β Import / Export β Export to file.
- Choose which contacts to export (e.g. only with the SIM-card).
- The contacts.vcf file will be saved in the Download folder, and can be opened on any device.
π‘
If you plan to migrate contacts to a new phone, export them in VCF format and then import them through the same menu, which ensures compatibility even with iPhones or devices on other OSes.
Recovery of contacts after resetting or breaking the phone
If you lost contacts due to a setting reset, phone breakdown, or accidental deletion, you can restore them in several ways:
- π Isa MIUI Backup: If you have previously created a local backup, connect your phone to your PC, find a folder /MIUI/backup/AllBackup/ And copy it to the new device. Then restore it through Settings. β Backup and reset β Recovery from backup.
- βοΈ From Mi Account: When you first start your phone after a reset, the system will prompt you to log in to Mi Account and restore data. If this step was missed, go to Settings β Accounts and synchronization β Mi Account β Synchronization of contacts.
- π± From Google Contacts: Add your Google account to your phone settings and enable contact sync. Data will pull up automatically.
- πΎ From the file VCF: Copy the.vcf file to your phone, open the Contacts app β Contact management β Imports/Exports β File-based import.
On Xiaomi devices with MIUI 14 firmware and later, it can take up to 24 hours to restore contacts from Mi Account due to optimization of background processes. If contacts do not appear immediately, restart your phone and check your Internet connection.
β οΈ Warning: If you are recovering contacts from an old backup MIUI On the new device, make sure the version MIUI For example, a backup with Redmi Note 10 (MIUI 12) may not be restored correctly on Xiaomi 13 (MIUI 14) due to changes in the database structure.
What to do if your contacts are missing or not synchronized
Sometimes users encounter problems when contacts suddenly disappear or stop syncing, and here are the most common reasons and solutions:
| Problem. | Possible cause | Decision |
|---|---|---|
| Contacts are not displayed in the appendix | Failure of the "Contact" application | Clear the app cache: Settings β Apps β App management β Contacts β Clear the cache |
| Not synchronized with Mi Account | Synchronization or problems with Xiaomi servers is disabled | Check your sync settings and restart your phone. If the problem persists, log out and log in again. |
| Duplicate contacts | Conflict between local and cloud contacts | Use the merge function in the Contacts app or turn off synchronization with one of your accounts. |
| Contacts are missing after MIUI update | Failure in the migration of the database | Restore data from the backup or reset the settings of the Contacts app (without data loss). |
If none of the solutions worked, try the following:
- Install an alternative contact app (like Google Contacts or Simple Contacts) and check if the posts are displayed.
- Try exporting contacts to.vcf via ADB: adb shell content query --uri content://com.android.contacts/contacts This command will display a list of all contacts in the terminal.
- If the phone is rooted, check the integrity of the file. contacts2.db The command is: Adb shell sqlite3 /data/data/com.android.providers.contacts/databases/contacts2.db "SELECT count(*) FROM raw_contacts;" If the result β 0, database damaged.
How to recover damaged contacts2.db database?
Transfer contacts to another Xiaomi phone (or brand)
If you are buying a new smartphone (for example, Xiaomi 14 instead of Redmi Note 11), you can transfer contacts in several ways:
- π Using Mi Account: Just log in to the same Mi Account on your new phone and contacts sync automatically.
- βοΈ Google: Add your Google account to your new device and contacts will catch up from the cloud.
- π Through file. VCF: Export contacts to a file on an old phone, transfer it to a new one (e.g. via Xiaomi Share or Bluetooth) and import.
- π± Through SIM-Map: Copy the contacts to SIM-You can import them on your old phone, and then you can import them on your new phone. SIM-The card holds a limited number of records (usually up to 250).
To transfer to other brands (such as Samsung or iPhone), the most reliable way is to use a.vcf file or sync through Google Contacts. If you transfer data to an iPhone, import.vcf through the Contacts app or iCloud.
π‘
When transferring contacts between Xiaomi devices via Mi Account, make sure that both phones use the same version of MIUI (or similar build numbers), otherwise sync errors may occur due to differences in database structure.