What is msgstore and what is it for

Photos for your WhatsApp profile

If on any occasion, browsing your device looking for what data you can delete to free up space, you have found yourself inside the WhatsApp folder with the files msgstore and they have seemed suspicious to you, you should rest assured, since it is not malware or anything dangerous. They are files created by the instant messaging app itself and have their function.

However What is msgstore? What is msgstore for? Here we will clarify all your doubts about what they are, what they are used for, and more details about these files. And so on. become an expert in Whatsapp.

how to know if they spy on me whatsapp
Related article:
How to know if my WhatsApp is spying on me: do this to get rid of doubts

What are msgstore files

mgstore.db.crypt14

The msgstore files are the encrypted backup copies that the application makes of the chats, backup copies that only contain the text of the conversations and groups in which we participate. That is, it will contain everything that is generated in the different ongoing chats, groups and also the archived ones.

These files usually have a extension like .db.crypt12 or .db.crypt14, which indicates that they are in a database format (db or database) and encryption (crypt) typical of WhatsApp. In this way, the files not only store the chats, they also guarantee the security and privacy of your conversations, so that these conversations cannot be accessed or altered without knowing how they can be decrypted, that is, without the decryption key. .

In this way, if you reinstall WhatsApp or change your phone, or if you have reset the system, you can restore your conversations from these files. Additionally, these files are also used to sync your chats between different devices if you have WhatsApp Web or a desktop version.

For example, in the previous image, you can see these:

  • msgstore.db.cryptXX
  • msgstore.db.yyyy-mm-dd.db.cryptXX
  • msgstore.db.aaaa-mm-dd (1) .db.cryptXX
  • msgstore.db.aaaa-mm-dd (2) .db.cryptXX

Instead of showing yyyy-mm-dd will be shown the date the file was created with the year-month-day format. We are only going to find four files in total in this directory. For example, in this case they are from November 9, 2021, and depending on the date on which the automatic backup was made, the date of the name may vary...

The msgstore.db.cryptXX file stores the chats that we currently have in the application, while the rest of the files store previous backup copies, which allows us to recover deleted WhatsApp conversations by deleting the main file msgstore.db.cryptXX and renaming the most recent copy to msgstore.db.cryptXX.

The final part, XX, in the file name msgstore.db.cryptXX refers to the number of version of encryption used by WhatsApp to protect your conversations. This number indicates the security level and encryption algorithm used on that specific file. For example, .crypt12 used to be common, or the more recent .crypt14. They can also be other numbers depending on the generation of the cipher.

Where are the WhatsApp msgstores and their structure?

msgstore

The msgstore files, depending on the device type and Android system version, can be found within the folders:

  • WhatsApp / Databases
  • android/data/com.whatsapp/Databases

La internal structure of a msgstore file It is quite complex and varies depending on the version of WhatsApp. However, in general, these files contain:

  • Contact information: names, phone numbers, etc.
  • Message content- Depending on the settings for backups configured in Whatsapp, they will contain text, images, or even videos, audios, etc.
  • Metadata: dates and times of messages, reading status, etc.

Importantly, these files are encrypted, meaning you cannot open them and read their contents with a simple text editor. If you try to do this, you'll see a series of random characters that don't make any sense.

WhatsApp Polls
Related article:
How to do surveys on WhatsApp

Sometimes you can also find some files type msgstore-increment-X.db.cryptXX. In these cases, they do not contain all the information stored by those described above, since it is not a complete backup or backup, but rather an incremental copy. That is, it is one that saves only the changes made to the files since the last backup, whether complete or incremental...

If we delete these files, all conversations will be deleted that we have in the terminal and we will leave all the groups we are part of, so it is an excellent option to start from scratch in WhatsApp or to restore a copy of WhatsApp without depending on the copy stored in Google Drive.
avatar whatsapp
Related article:
How to create your avatar for WhatsApp

Whatsapp encryption versions

msgstore encryption

As I mentioned before, the database files are encrypted. In May 2021, WhatsApp began use crypt14 termination since version 2.21.8.17. At the moment, it is the current one that is still in force, although other versions have also been seen in the past.

In fact, if you have not updated your WhatsApp application in a while or use a very old version, it is likely that instead of using crypt14, these are crypt7, crypt8, crypt10 or crypt12. In the end it is the same type of file, but with a different level of encryption. The higher the number, that is, the more recent the version, the more robust it is against possible attacks.

Change WhatsApp font color
Related article:
How to write colorful in WhatsApp

By having a different encryption level, applications that allow opening files with this extension, if they have not been updated, they will not allow access to these conservancies.

Can I delete msgstore files?

delete msgstore

The quick answer is yes, you can delete msgstore files, but you should do it with caution. These files contain your WhatsApp conversations, so the consequences of getting rid of them are:

  • Chat history loss: The most obvious consequence is that you will lose all your conversations, both text messages and multimedia files (photos, videos, etc.) if you delete the main msgstore file, the one that contains the current information, and do not have a copy in the cloud.
  • Inability to restore chats from that backup- If you delete the msgstore files, you won't be able to restore your chats from that specific backup in the future.
If you have WhatsApp cloud backup enabled (Google Drive or iCloud), you can restore your chats from there, even if you have deleted the msgstore files from your device. However, it is likely that the local upload and the upload to the cloud are not exactly at the same time, so some of the information could be lost if it is not the last one that was done.

How to manage my Whatsapp chats from a msgstore file

Person sending messages on WhatsApp.

With msgstore files you can manage chats, both restore backups and also generate new, more current copy files:

Create msgstore (current backup)

If you don't want to lose any of your WhatsApp, you can generate backups by forcing the moment in which you want them to be created, or change the backup frequency in WhatsApp, to generate the msgstore files on your storage unit:

  1. Open WhatsApp.
  2. Click on the three points.
  3. Then select Settings.
  4. Then access Chats.
  5. Tap on Backup.
  6. You can now press Save to create a current copy.

Just above the button it shows you the date of the last backup made, you will also see options to choose where you want to save the cloud copy, such as GDrive, or modify the frequency at which the copy will be made automatically.

Restore a backup from msgstore

Instead, for restore a previous copy of your conversations, if you have deleted a chat or want to recover a lost conversation, you can follow these other steps:

  1. Open the file manager and go to the path where the msgstore files are located.
  2. Now, imagine you want to choose the backup named msgstore-2024-02-29.1.db.crypt14. In this case, you just have to rename the file as msgstore.db.crypt14.
  3. Then restart and access Whatsapp and you will see that it should have been restored.

Export chats to another device

To send a copy of WhatsApp chats We must perform the steps that I show you below:

  1. We open WhatsApp.
  2. We click on the three dots located in the upper right corner of the application.
  3. Go into Settings.
  4. Then go to Chats.
  5. Next we click on Chat History.
  6. Then Export chat.
  7. Finally, we select which chat we want to save and we store it on our device, send it by email, etc.

This function is especially useful when we want share the conversation with other people that we have maintained without having to take screenshots.

How to open msgstore files

To open msgstore.db.cryptXX files it is necessary to use the WhatsApp Viewer application. But first you must locate where the key is so that the application can decrypt files, since without it it will never be possible to access its content. Otherwise, you will only be able to see strange symbols.

The key is located in the directory data/data/com.whatsapp/files/key (may be hidden) is unique for each device and that of other terminals does not work.

WhatsApp
Related article:
How to hide WhatsApp contacts

This is where we encounter the first problem, since to access the unlock key root access required to the device. If not, we will never be able to use the key that decrypts the encryption used in the backups, so we will never have access to stored conversations in those copies.

If our device has root permissions, the first thing to do is download the WhatsApp Viewer application, a completely free application that we can download via Git-Hub, which implies that we can be completely calm about its operation.

how to schedule messages on whatsapp
Related article:
How to schedule messages on WhatsApp

The application is portable, so we do not need to install it on our PC, we just have to click on it twice for it to start.

  1. Once we have located the backup files (mgstore.db.cryptXX) and we have accessed the directory where the decryption key is located, we open the application and click on File.
  2. Next, we select the type of crypt format (crypt5, crypt7, crypt8, crypt 12 or crypt 14) that we are going to decrypt.
  3. Next, we select the folder where both the backup files are located (mgstore.db.cryptXX) and where we have saved the copy of the key to decrypt.
  4. Finally, we click on the Decrypt button to start the process.

Once there finished the process, the personal and group chats will be displayed in the left column while on the right side we will have access to the conversations.

Once we have access to all the chats stored in the mgstore.db.crypt files, from the application itself, we can export the one we want to TXT format. HTML or JSON.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.