Have you ever lost contacts after resetting your phone or flashing the firmware? Or did you just want to transfer them to another device without using cloud services? Then you need to know where exactly does Android store contact files on the internal memory of the device. This information will be useful not only for backup, but also for manual data recovery if standard methods do not work.

Unlike photos or music, which are located in open folders like DCIM or Download, contacts are hidden deep in system directories. Their location depends on the version of Android, the smartphone manufacturer (Samsung, Xiaomi, Google Pixel) and even on whether they are synchronized with the account Google. In this article, we will analyze all the possible options - from the standard path to hidden databases, and also show how to safely extract and edit these files without the risk of damaging the system.

We warn you in advance: working with system folders requires caution. One wrong action can lead to data loss or application crash Contact. Therefore, before any manipulation be sure to create a backup copy through phone settings or third-party utilities.

Where contacts are physically stored on Android: standard paths

On most devices, contacts are stored in an SQLite database named contacts2.db. This file is located in a protected system folder, access to which is limited even for a user with rootrights. Here are the main paths depending on the version of Android:

  • ๐Ÿ“ Android 4.4โ€“7.0 (KitKatโ€“Nougat): /data/data/com.android.providers.contacts/databases/contacts2.db
  • ๐Ÿ“ Android 8.0โ€“10 (Oreoโ€“Q): /data/user_de/0/com.android.providers.contacts/databases/contacts2.db
  • ๐Ÿ“ Android 11 and newer: the path remains the same, but access becomes more difficult due to the tightening of the permission policy (Scoped Storage).

On smartphones Samsung (with shell One UI) and some models Xiaomi (MIUI) the path may be different: /data/data/com.sec.android.provider.contacts/databases/contacts.db or /data/user/0/com.miui.contacts/databases/contacts2.db.

It is important to understand that this file contains not only phone numbers, but also all related information: names, email addresses, birthdays, notes and even call history (if it is integrated) Database size. can reach several megabytes, especially if you have been actively using the phone for many years.

โš ๏ธ Attention: Direct editing of the file contacts2.db without specialized tools (for example SQLite Editor) can lead to damage to the data structure If you are not confident in your. actions, use standard export methods through the app Contact.
๐Ÿ“Š How do you usually reserve contacts?
Via Google Account
I export to a VCF file
I use third-party applications
I never do backups

How to access the contacts folder: 3 working methods

You can get to the system contacts folder in several ways. The choice of method depends on whether you have it, what version of Android is installed, and whether you are ready to use a computer. complex. root access, what version of Android is installed, and whether you are ready to use a computer. Let's consider all the options - from the simplest to the most technically complex.

1. Through a file manager with root access

If your smartphone is unlocked (root), it is enough to install any advanced file manager, for example Root Explorer or FX File Explorer. Algorithm of actions:

  1. Open the file manager and give it root access when prompted.
  2. Go to the path /data/data/com.android.providers.contacts/databases/ (or an alternative if you have Samsung/Xiaomi).
  3. Copy the file contacts2.db to a safe place (for example, to SD card or to the cloud).

For backup, just copy this file. To restore contacts from the backup, you need to replace the current database with the saved version (after renaming the original).

2. Without root: via ADB. (Android Debug Bridge)

If you do not have root access, but your phone is enabled USB debugging, you can extract the database using the commands ADB. To do this:

  1. Connect the phone to the PC and make sure the drivers are installed. installed (use Minimal ADB and Fastboot or Android Studio).
  2. On the command line, run:
    adb shell
    

    run-as com.android.providers.contacts

    cp /data/data/com.android.providers.contacts/databases/contacts2.db /sdcard/

    exit

    exit

    adb pull /sdcard/contacts2.db C:\backup\

This method works on most devices up to Android 10. On newer versions, you may need to additionally configure permissions or use alternative commands.

3. Via a TWRP backup (for advanced users)

If you have custom recovery installed on your phone TWRP, you can create a full backup of the section /data, which includes the contact database. To do this:

  • ๐Ÿ”ง Boot into TWRP (usually by pressing Power + Volume Up).
  • ๐Ÿ“ฅ Select Backup โ†’ Select Partitions โ†’ Data.
  • ๐Ÿ’พ Save the backup to an SD card or OTG drive.

Later, you can restore the backup or extract the contacts2.db file from the archive using a tool like 7-Zip.

โ˜‘๏ธ Preparing to extract contacts

Done: 0 / 4

What to do if the contacts folder is empty or the file is damaged?

Sometimes when trying to copy contacts2.db users encounter that the file is zero size or does not exist at all. This can happen for several reasons:

  • ๐Ÿ”„ Contacts are synced only with Google Account and are not stored locally.
  • ๐Ÿšซ The application Contact has been reset or reinstalled.
  • ๐Ÿ› ๏ธ The system folder was cleaned manually or by third-party software (for example, Clean Master).

In such cases, try the following steps:

  1. Check synchronization with Google: go to Settings โ†’ Accounts โ†’ Google โ†’ Synchronization and make sure that the option Contact enabled. If yes, your data is stored in the cloud and can be restored via contacts.google.com.
  2. Use alternative applications: some contact managers (for example, Simple Contacts or Truecaller) store data in their own databases. Check the folders of these applications in /data/data/.
  3. Restore from cache: sometimes temporary contact files remain in /data/data/com.android.providers.contacts/cache/. readable format.

If the file contacts2.db is damaged (for example, due to a sudden power outage), try restoring it using utilities like SQLite Database BrowserOpen the file and run the command. PRAGMA integrity_check โ€”it will show structure errors.

โš ๏ธ Attention: If you suspect that contacts were deleted due to a virus or glitch, Do not write new data to the device before attempting to restore. Each new write may overwrite deleted memory sectors.

How to export contacts to a readable format (VCF, CSV, Excel)

File contacts2.db is a database SQLite, and in its raw form it is unsuitable for viewing. To convert it to a convenient format (for example .vcf to import it into another phone), use the following methods:

1. through the app Contact Backup & Restore

This is one of the few applications that can work with the system contact database without root access (on some devices). Algorithm:

  1. Install the application from Google Play.
  2. Select Backup and save contacts to a file .vcf or .csv.
  3. Send the file to yourself by email or save to the cloud.

The advantage of this method is its simplicity and absence of risk of damaging system files. Disadvantage: not all contact fields can be exported correctly (for example, custom labels).

2. Manual extraction via SQLite

For advanced users: you can manually extract data from the database using SQLite Browser or the command line. Example request for export to CSV:

sqlite3 contacts2.db

.headers on

.mode csv

.output contacts_export.csv

SELECT * FROM raw_contacts INNER JOIN data ON raw_contacts._id=data.raw_contact_id;

.exit

This command will create a file contacts_export.csv with all fields. To simplify, you can filter only the necessary columns (for example, phone numbers and names):

SELECT

raw_contacts.display_name_primary,

data.data1 AS phone_number

FROM raw_contacts

INNER JOIN data ON raw_contacts._id=data.raw_contact_id

WHERE data.mimetype_id=5;

Where mimetype_id=5 corresponds to phone numbers (other values: 1 - names, 2 - organizations, 3 - notes, etc.).

3. Online converters (for small databases)

If you have a backup contacts2.db, but do not want to understand SQL, you can use online services like SQLite to VCF Converter. Upload the file to the site, select the output format (VCF or Excel) and download the result.

โš ๏ธ Attention: By uploading the database to third-party services, you risk leaking personal data. Use only trusted tools or work with the file locally.
๐Ÿ’ก

If you need to transfer contacts to iPhone, export them to VCF format and then import via iCloud or email. This will save all fields, including photos of contacts.

How to restore contacts from a backup: step-by-step guide

If you have a backup file contacts2.db or exported .vcf, you can restore contacts in several ways. Important: before restoring disable synchronization with Googleto avoid data conflicts.

1. Restoring through a file manager (with root)

If you have root access:

  1. Rename the current file contacts2.db to contacts2.db.bak (in case of a rollback).
  2. Copy the backup to folder /data/data/com.android.providers.contacts/databases/.
  3. Restart your phone.
  4. Open the application Contact โ€”the data should appear.

2. Import from VCF

For files .vcf (business cards):

  1. Place the file on the internal memory of the phone.
  2. Open the application Contact โ†’ Settings (โš™๏ธ) โ†’ Import/Export.
  3. Select file .vcf and confirm import.

On some firmware (for example, MIUI) the path may differ: Contacts โ†’ Contact management โ†’ Import/Export.

3. Recovery via ADB (without root)

If you do not have root, but have a backup contacts2.db, you can try replacing the file via ADB:

adb push C:\backup\contacts2.db /sdcard/

adb shell

su

cp /sdcard/contacts2.db /data/data/com.android.providers.contacts/databases/

chmod 660 /data/data/com.android.providers.contacts/databases/contacts2.db

chown system:system /data/data/com.android.providers.contacts/databases/contacts2.db

exit

exit

adb reboot

This method will only work if you have rights su (even temporary). Unfortunately, it is not available on stock firmware without root.

What to do if after restoration the contacts are not displayed?

Check whether filtering is enabled in the Contacts application (sometimes duplicates or contacts without numbers are hidden). Also clear the application cache in Settings โ†’ Applications โ†’ Contacts โ†’ Memory โ†’ Clear cache.

Features of storing contacts on different firmware

Smartphone manufacturers often modify the standard contact storage system. This may make accessing files more difficult or require additional steps. Let's consider the most popular brands:

Firmware / Brand Path to contacts Features Backup method
Stock Android (Pixel, Nexus) /data/user_de/0/com.android.providers.contacts/databases/contacts2.db Maximum compatibility with standard tools ADB. Export via Settings โ†’ Google โ†’ Backup.
Samsung One UI /data/data/com.sec.android.provider.contacts/databases/contacts.db Uses its own database contacts.db instead of contacts2.db. Application Samsung Smart Switch or Settings โ†’ Accounts and archiving.
Xiaomi MIUI /data/user/0/com.miui.contacts/databases/contacts2.db Often duplicates contacts to the cloud Mi Cloud. Export via Contacts โ†’ Settings โ†’ Management contacts.
Huawei EMUI /data/data/com.android.providers.contacts/databases/contacts2.db On new devices (without GMS), contacts are linked to Huawei ID. Application Phone Clone or Settings โ†’ Huawei ID โ†’ Cloud.
ColorOS (Oppo, Realme) /data/user_de/0/com.android.providers.contacts/databases/contacts2.db Supports export to .vcf and .csv without root. Contacts โ†’ More โ†’ Management โ†’ Import/Export.

On devices with Android Go (for example, Nokia 1 or Samsung Galaxy J2 Core) the path to contacts may be the same as the standard one, but the database size is usually smaller due to limited functionality.

โš ๏ธ Attention: On some firmware (for example, MIUI 14+) access to system folders is blocked even for root users. In such cases, the only reliable way to backup is to use built-in tools or synchronize with the cloud.

Common errors and how to avoid them

Working with system contact files is fraught with errors that can lead to data loss. Here are the most common problems and how to solve them:

  • ๐Ÿ”Œ "Insufficient rights to access the folder": Make sure you have root access or permissions are configured correctly ADB. On Android 11+ you may need to disable Scoped Storage via Magisk.
  • ๐Ÿ—ƒ๏ธ "The contacts2.db file is empty or damaged": Check whether synchronization with Googleis disabled. If contacts are stored only in the cloud, the local database may be empty.
  • ๐Ÿ”„ "After restoring, contacts are duplicated": Before restoring, clear the current contacts via Settings โ†’ Applications โ†’ Contacts โ†’ Storage โ†’ Clear data.
  • ๐Ÿ“ฑ "Contacts are not displayed after VCF import": Make sure the file is not damaged. Try importing it on another device or via Google Contacts.

Another common mistake is trying to edit contacts2.db in a text editor. This file has a binary structure and any manual changes will lead to its corruption. For editing, use only specialized tools, such as:

  • ๐Ÿ› ๏ธ SQLite Editor (for Android with root)
  • ๐Ÿ’ป DB Browser for SQLite (for PC)
  • ๐ŸŒ SQLite Online (for quick viewing)

If you accidentally deleted a file contacts2.db, do not panic. Try restoring it using utilities like DiskDigger or Recuva (if the phone is connected to the PC in storage mode). The chances of success are higher if little time has passed since deletion.

๐Ÿ’ก

Before any manipulations with system contact files, always create a backup copy of the current database. Even if you just plan to view its contents, one wrong click can erase all the data.

FAQ: Answers to frequently asked questions

Is it possible to transfer contacts from Android to iPhone without a computer?

Yes. Export your contacts to a file .vcf (via the app Contact or Google Contacts), send it to your email, open the email on your iPhone and import the file. Alternatively, you can synchronize contacts with Google Account, and then add this account to your iPhone in Settings โ†’ Passwords and accounts.

Why contacts were not restored from the phone after resetting Google?

Possible reasons:

  • Synchronization was disabled before the reset.
  • You logged into another Google Account after the reset.
  • The device has custom firmware installed without Google Services.
  • The contacts were saved not in Google, but in the memory of the phone or SIM card.

Check the synchronization settings and make sure that you are using the correct account.

How to find out where exactly are my contacts stored: on the phone or in Google?

Open the application Contact, click on the three dots (โ‹ฎ) โ†’ Settings โ†’ Manage contacts (or a similar item). The data source will be indicated here. You can also go to contacts.google.com โ€”if there are contacts there, they are synchronized with the cloud.

Is it possible to restore contacts if the phone does not turn on?

Yes, but this will require:

  • Remove the memory chip (eMMC) and connect it to the PC via a card reader (soldering skills required).
  • Use ADB in mode fastboot (if the phone somehow reacts to connecting to a PC).
  • Contact a service center - they have equipment for retrieving data from non-working devices.

Independent recovery in this case is risky and can lead to complete loss of data.

How to protect contacts from accidental deletion?

We recommend combining several methods:

  • ๐Ÿ”„ Enable automatic synchronization with Google Account.
  • ๐Ÿ“ฑ Regularly export contacts to a file .vcf and save it to the cloud (Google Drive, Dropbox).
  • ๐Ÿ” Use backup applications, for example Swift Backup (requires root) or Super Backup.
  • ๐Ÿ“ง Send yourself the exported .vcf mail - this is the most reliable way, independent of the phone.

Do not rely on just one method - it is better to have several backup copies.