Updated: December 20, 2021
A few days ago, I encountered a weird set of problems in WhatsApp on one of me Android phones. I was suddenly unable to either download documents or images sent to me by my contacts, or upload and send documents and images to my contacts. WhatsApp would complain with a message that reads along the lines: "Sorry, this media file doesn't exist on your internal storage."
I realized that WhatsApp had probably broken, or more specifically, the database. So I decided to perform a local database restore. I've done this a few times in the past. You uninstall WhatsApp and delete data. You connect your phone via USB, you navigate to the WhatsApp folder, and you copy the (backed up) contents in. Then, you reinstall WhatsApp, go through the setup process, and job done. Alas, this wasn't working.
Problem in more detail
So we know that WhatsApp isn't working. Okay. The real problem is the inability to perform a local data restore. The WhatsApp folder on your Android phone has three sub-directories: Backups, Databases and Media. These three directories contain the following data: your application settings, your actual messages, and all your different media files, like gifs, photos sents and received, videos, audio recordings, etc.
If WhatsApp is not working correctly, you can just copy the contents of the Databases directory onto your phone. This will restore your WhatsApp activity to the date the database copy was made. So if it's from say three days ago, anything done in the last three days will not be shown in the WhatsApp interface.
I did this, but nothing. During the setup process, WhatsApp did not see my local backup. It would only ask me about trying to look for a backup on my Google account, and nudging for a permission to do so. The really maddening part is that I've done this local copy & paste many times before, without issues.
As it happens, in Android 11, the directory structure where WhatsApp resides has changed. It used to be:
Internal Storage > WhatsApp
But now, it is:
Internal Storage > Android > media > com.whatsapp > WhatsApp
So what you need to do is:
- Go to the Android folder, and create the sub-directories as shown above.
- Then, copy the WhatsApp folder in its entirety into this new location. If the Paste option is grayed out, then you need to first create an empty folder in it, and then you can copy the contents.
I did this, and when I set up WhatsApp again, this time, it DID prompt me to restore a local backup. I was able to restore the application, and now the download and upload of media was working correctly again. However, the database was only valid to about 8 days prior. So I lost a little bit of chat history and such.
Why did this happen?
I have a pretty decent guess. On December 2, there was a phone system update. This is also the last date when WhatsApp created a daily rotation backup of its database - normally, the program retains seven daily database files, typically titled: msgstore-[timestamp].crypt14 or similar.
I have not tried to send (or received any media) until I noticed the problem on December 10.
I think that Android slash WhatsApp simply "changed" the location of the application from the old structure to the new one, which meant the application couldn't find the necessary files under the new structure. In technical parlance, the pointer or symlink was changed, but the data wasn't ported over.
This is quite annoying, because you'd expect the data structures not to change, especially not since they already worked just fine early on in Android 11 (and prior). The sudden shift to the new folder path simply makes no sense.
Indeed, now, if I examine the storage on the phone, I can see that the new path is getting updated correctly, but the old one isn't used anymore. More excellence in software engineering, except it's harder to debug on the phone as opposed to the classic PC.
I truly hope you will find this article useful and valuable to your own needs. After all, if you're reading this, you probably need to restore your WhatsApp database, and you are not using the cloud backup. Indeed, that's always an option, but like many things mobile, it requires sending yet more of your data to the "cloud", yet more linking of accounts, and even less privacy. Convenience yes, something I want no.
The real problem here is that a system update most likely botched something. We're talking a device that follows the Android One program, so I'd expect a bit more diligence. Then again, in the so-called modern software world, I guess not. Anyway, if you have WhatsApp issues and need a local restore, see whether moving data into the new folder structure helps. And thus endeth another fine tutorial born out of necessity.