Many users of smartphones running an operating system Android when manually studying the file system are faced with mysterious files whose names consist of incomprehensible abbreviations. One of the most common such elements is a file called msgstore. It is often found in messenger folders, in particular WhatsApp, and takes up a significant amount of the device's internal memory.
This object is a critical component for the operation of the messaging application, as it contains the entire history of your correspondence. Deleting or damaging this file can lead to complete loss of data accumulated over months or even years of active communication. Understanding its structure and principles of operation will allow you to competently manage backups and avoid unpleasant surprises when changing devices.
In this article, we will analyze in detail the technical purpose of this file, consider the evolution of encryption formats and answer the question of whether it can be opened on a computer without special utilities. You will learn how to distinguish the current database from archived copies and what actions to take to recover deleted messages.
Technical purpose and structure of the database
File msgstore.db is a local database created on the basis of the engine SQLite. It is in this file that the messenger stores all text information: sent and received messages, time stamps, delivery and reading statuses, as well as links to media files. The structure of the database is organized in such a way as to provide instant access to chat history when the application is launched.
In addition to the main file, in the directory you can often find variations with the addition of a date, for example, msgstore-2023-10-25.1.db.crypt14. These are automatic backups that the system creates daily at a specified time. The presence of such files allows you to roll back the state of the correspondence if the current database was damaged or if you accidentally deleted an important chat.
It is important to understand that the file msgstore does not store the media files themselves (photos, videos, voice messages) inside itself. Only the paths to these files and their metadata are stored in the database. The media files themselves are located in separate folders, usually in a Mediadirectory. Therefore, the size of the database file is usually small compared to the total space occupied by the messenger, unless you have sent thousands of text messages.
โ ๏ธ Attention: Direct editing of the file msgstore.db by third-party database editors without deep knowledge of the table structure can lead to irreversible damage to the file. The messenger simply will not be able to read the damaged database and will offer to restore it from the cloud or delete all local data.
If you plan to transfer correspondence to a new phone, make sure that the msgstore.db file has the current creation date. Old backups may not contain the latest important dialogs.
Decryption of file names and encryption versions
Users are often lost in the abundance of files with similar names but different extensions. The key element here is the suffix .cryptfollowed by a number. This number represents the version of the encryption algorithm that was used to protect the data during a specific period of time. With each major version of the application WhatsApp algorithms change to improve security.
For example, a file with the extension .crypt12 was relevant several years ago, while modern devices use .crypt14 or .crypt15. An attempt to restore a backup copy of an old format on a new version of the application may require preliminary conversion or may not be possible at all without using intermediate versions of the software.
Below is a table demonstrating the evolution of encryption formats and periods of their active use:
| File extension | Encryption version | Support status | Features |
|---|---|---|---|
.crypt8 |
Outdated | Not supported | Used on older versions of Android |
.crypt12 |
Average | Limited | Requires application downgrade for recovery |
.crypt14 |
Current | Full | Standard for most devices in 2023-2026 |
.crypt15 |
Latest | Full | Used in the latest messenger updates |
The file name can also contain a prefix msgstore no date - this is always the latest, active database that the application is using right now. Files with a date in the name are archived and are stored for insurance.
Where the msgstore file is located in the file system
Finding the file location depends on the operating system version system Androidinstalled on your smartphone. In older versions of the OS (before Android 10-11), the path was quite simple and accessible for direct viewing through any file manager. The path looked like this: /sdcard/WhatsApp/Databases.
Starting with the introduction of the Scoped Storage policy (limited storage) in new versions of Android, access to system application folders has been limited for security purposes. The database files have now migrated to the protected directory. The current search path looks like this: /Android/media/com.whatsapp/WhatsApp/Databases or /Android/data/com.whatsapp/files/Databases.
To access these folders on modern smartphones, you may need to grant special permissions to the file manager or use a computer with software debugging enabled. USB. Some built-in explorers simply do not display the contents of the folder Android/data, considering it system.
How to access the Android/data folder on Android 11+
To access hidden folders on new versions of Android, download the file manager "Files by Google" or "Solid Explorer". When you try to enter the data folder, the application will ask for special system permission - confirm it and you will see the contents.
The process of restoring correspondence from a backup copy
Restoring message history from a local file msgstore necessary when cloud synchronization with Google Drive is not available, outdated or damaged. This process requires accuracy and precise renaming of files, since the application looks for a strictly defined name to start the import procedure.
Before starting manipulations, be sure to create a copy of the current folder Databases in a safe place. If something goes wrong, you can return everything to the way it was. The algorithm of actions involves deleting the current active file and assigning the name of the active database to the archive that you want to restore.
Step-by-step guide for recovery:
- ๐ Open the file manager and go to the
Databasesmessenger folder. - ๐๏ธ Delete or rename the current file
msgstore.db.cryptXX(add the word to the name.old). - โ๏ธ Select the desired archive file with the date, for example
msgstore-2023-10-01.1.db.crypt14. - ๐ Rename it, removing the date and version number, so that only
msgstore.db.crypt14. - ๐ฒ Reinstall the application or clear its data in the system settings.
- โ When you first launch, agree to restore from a local copy.
โ๏ธ Preparing for recovery
โ ๏ธ Attention: The encryption version in the renamed file must match the version supported by the application you have installed. If you rename the file
.crypt12to.crypt14manually, recovery will not occur since the decryption keys will not work.
Is it possible to open and read the file on a computer
Many users want to read the contents of the file msgstore on your computer to find a deleted message or retrieve data. Directly opening the file in a text editor, such as Notepad++ or Notepadwill only show a set of unreadable characters and hieroglyphs. This happens because the database is encrypted and has a binary structure.
To read the contents, two conditions must be met: decrypt the file and open it as a database SQLite. Decryption is possible only if you have a special key, which is stored in the system partition of the phone (/data/data/com.whatsapp/files/key). It is almost impossible to obtain this key without superuser rights (Root) on modern Android.
There are third-party viewer apps that are positioned as tools for reading these files, but most of them require the same decryption key. Without it, the file remains a "black box". If you have root access, you can extract the key, decrypt the database using utilities like whatsapp-xtract and then open the result in the app DB Browser for SQLite.
To view message history on a PC, it is easier and safer to use the official "Linked Devices" feature in WhatsApp Web than to try to hack local database files.
Cleaning memory and managing archived copies
The folder Databases can grow over time, occupying hundreds of megabytes of memory. This happens because the messenger stores the latest 7 daily backups by default. If your correspondence is very active, each such file can weigh tens of megabytes.
Regular cleaning of outdated copies is a great way to free up space without losing functionality. You can safely delete files with dates that are older than a week or a month, leaving only the most recent msgstore.db and, possibly, one fresh copy with a date from yesterday.
To disable the creation of local copies and save space constantly, you can change the settings inside the application. However, this should be done carefully, relying only on cloud synchronization. In the messenger settings, go to the section Chats โ Backup of chats and disable the option to create local copies, if this option is provided in your software version.
โ ๏ธ Attention: Before mass cleaning of the folder
Databasesmake sure you have an up-to-date backup in Google Drive. Local files are your last line of defense if cloud synchronization fails.
Optimal storage strategy: keep 1 active msgstore.db file and 2-3 recent archived copies. The rest can be deleted to save space.
What happens if you simply delete the msgstore.db file?
If you delete the file msgstore.db, the next time you start the application, the correspondence history will disappear. The messenger will offer to restore data from the cloud (Google Drive) or from the remaining local copies. If there are no copies, a clean slate will begin and old messages will be lost forever.
Why does the msgstore file weigh so much?
Although the text takes up little space, the database includes metadata for all messages, statuses, group information and links. If you have thousands of chats and a long history, the file size can reach hundreds of megabytes. Also, the size depends on the number of image thumbnails included in the database.
Is it possible to rename crypt14 to crypt15?
No, simply renaming the extension will not change the encryption algorithm inside the file. The application will try to decrypt the file using the old key and algorithm, but will not be able to do this and will throw a recovery error. Conversion between encryption versions is impossible without official tools.
Where is the decryption key stored?
The key is stored in a protected system directory /data/data/com.whatsapp/files/key. This folder is not accessible to regular applications and users. You can extract the key only on a device with Root access rights.