[Android Q&A, Help & Troubleshooting] Albert83BCN:
Hi guys!

I have been facing this issue this whole week while trying to move all my chats to a new phone I just bought as with the old one the charging port was dying and I could not bear it anymore. So almost everything restored smoothly from Google Backup and it was like being in my phone again with a few wizard steps but then I Installed WhatsApp (WA) and gone through the typical activation and restoring process and. as many, I got stuck at the 24% sometimes, some others 31% and 39%, and never got past the 39%.

I Tried almost everything: restoring from Google Drive, transfer all WhatsApp directory to internal storage and trying to restore from there, etc. Going back to the old phone to create fresh backups just in case they were corrupted as many people suggests, getting every time more delay to be able to activate WhatsApp again up to 12h for both SMS and call activation... just to mess again and feel back at square one, I guess you all feel the pain.

Well, the good news is that I finally managed to restore all the chat history!!! (well, cannot be certain that 100% was restored but I do not miss anything ATM and I can go back up to 2012 chats so I guess that qualifies as "everything" hehe).

So, I'm posting here because I've been searching a lot on the forums and the reddit and for all the people that is having this issue recently, almost no body came back to report success and I know it feels really discouraging :( It certainly gives the impression that this issue has no fix at all, and that you should accept losing all the chat history and starting from the start again. But from all the data I've been gathering during this week, at least two or three people reported to eventually being able to restore the chat; they fell in one of these two categories: they either transferred to a different phone where the backup seemed to restore okay, and then exported and restored in the target phone with success (something like a "bridge" restore mode, most of the cases I've read did it this way) or they finally succeeded by sheer brute force by trying again and again and again.

I fall in this 2nd category. In the most recent attempt I was doing what I've been doing again and again and again with just minor variations in the workflow and finally succeeded. TL; DR; I think in reality in many cases attempts could succeed by just letting the phone restore the backup endlessly, by not giving up and assuming the restore process went wrong when it has been stuck forever at either 24, 31 or 39% and force closing..

But I know in the midst of desperation OCD kicks in and you want step-by-step success case scenario reproduction so I will tell you all the steps that I followed that I can remember that got me to finally have the backup to end successfully:

0. First of all, in the winning attempt I had already uninstalled WA from the new phone and removed totally the WA folder in the internal storage / sdcard storage. Not sure this is mandatory but just to tell this was the case.

1. Since I got WA working perfectly on the old phone at every moment, I backed up locally for the Nth f%!?&·( time. This left me with the latest local backup plus a few others in the databases folder as a result of keep messing up.

2. I copied the full WhatsApp directory from the internal storage of the old phone to a safe place. This could be the PC or whatever, but PC transfer via USB seems too sloppy. You maybe could do it via ADB, whatever, I went by the route of coping it to the external SD with some random explorer utility like ES File Explorer. It does not matter, the point is to be able to backup the full WhatsApp folder in order to restore it as similar as possible as the original. What we are more interested right now is in the database folder but having all images, videos etc in place will help in getting it like before the easiest way. (Disclaimer: Ok guys sorry if some steps are too obvious to XDA users which usually are highly educated in the matter, but I was thinking of sharing/linking this text on the reddit and others, so please bear with it).

3. I installed latest WA in the new phone, opened the app (I intended to not open but I somewhat forgot) and got to the welcome screen, immediately closed the app at that step.

3. I restored the full folder to the new phone internal storage, pure copy/paste style (as said, in my case via the SD since both phones have SD slot and was very convenient, but via USB, cloud, etc. can be done).

4. I went to the databases folder and only kept the msgstore.db.crypt12 file and the latest backup with a date (ie: msgstore-2019-11-21.db.crypt12), deleted the rest. Honestly I do not think this is crucial but I somewhat wanted to make it easier for WA to know which one to target, I thought about keeping only the msgstore.db.crypt12 but some random dude pointed that the one with the date was needed. I was under the assumption that file structure is identical in both but just wanted to get done with this and keep both, just in case.

5. Before opening again the WA to try to activate and restore with this full local copy, I opened the Android settings app and went to applications > whatasapp > storage, as suggested by user redweaver, thanks for the tip! by keeping looking at the storage usage of the app during the restore process we could get insight about if it was really doing something or the app was really stuck. Keep open for now. In my case, I saw also on the old phone that my data used for the app was 780+ MB, so I had an idea of what should be on the new phone by the time it finished (if it did!).

5b. I don't think this is really necessary but I did it just in case. I was planning to go to work and let the thing running as long as it would need, and I would make sure that the process would get maximum uptime and nothing would get in the way. So I went to Applications > WhatsApp > Battery usage (or something like it) and disabled the battery optimizations for this app. I also went to the developer mode settings and enabled do not lock the phone while it is charging and everything that looked like it might be relevant. Again, most likely this has nothing to do, but reproducible steps, right? :)

6. Now open WA and activate it as usual, but when it seems that the activation step ended and you go to the next screen, immediately put the phone in air plane mode or disable data/WiFi, whatever. The goal is that it cannot reach Google Drive to look for the online backup. Honestly maybe in the end is not the culprit of GDrive but many people states that the GD backup is broken at this time and suggests going the local route, so we will do it like this.

7. WA should tell you that looking for the backup is going too slow and to skip this step (sorry to not have exact message, I have it in Spanish, but something in these lines, BTW excuse my somewhat limited English :D). The point here is to click on the link that says skip the step and when you are prompted with a popup, click also on Skip.

8. WA will display the typical restore / transfer-like screen where the process starts. At this point you have to enable again data plan / WiFi at least or exit air plane mode, don't know really but even if restoring from local it complains about not having internet connection, maybe needs it to encrypt with the key or something? don't know.

9. Now is the feared moment! Even this time, I got somewhat stuck at 31% again. I left it do its thing, and some time later, it prompted for the popup that has a progress-bar from 0 to 100 (honestly, what is the difference between both?!) which also got stuck at 31%. If you let it be, it starts going back and forth many times, I guess maybe its going chat per chat and the progress-bar represents each one? Dunno. Thing is, even in the prior attempts I got at this point and the backup did not finish successfully. But this time I was decided to let it do its thing as much time as it would take, until the end. In the process the phone might display a pop up saying that WA does not respond. I clicked a few times in the 'keep waiting' option, then I just forgot because I did not have time to mess with it and hoped that it was still working on the background, which bring us to step 10.

10. While we are contemplating the backup process, we can go to the settings app again and look how the internal data is going for the WA. In my case, after some time under the restore process, when I went there I saw WA had occupied 0.91 GB of data space. After going back and forth again between WA and settings, the usage keep growing: 0.96, 1.03, 1.10... I thought it was on the right track, and encouraged me to keep waiting. Maybe in the end the process is too slow for old databases. Note that some people speculates that having messages from very long ago might be the culprit here due to changes in the table structure and that this might be the reason breaking the restore process. And maybe it is the case, but even if it is, in my case I finally succeeded where previously I didn't and without deleting anything, so this does not seem to be a deal-breaker or I would have never succeeded. I say it because some people reported that deleting old conversations and trying again finally made them succeed. Now I suspect the true reason was simply that by making the database smaller the process finished earlier, but YMMV.

11. Cannot be totally sure, but in my case, I noticed that leaving WA on the background and clicking on the WA icon again might stop the process for true and bring a message about not being able to recover the chats, I got this previously, do not try to open the WA normally, only leave it temporally to look to the space usage in the settings to get back to it by swyping between recent apps to keep the same instance open and working, this was a key point in my success trial that did not happen during the previous ones.

12. And finally, while I kept switching between WA and the settings and when I last saw like 1.30GB of space used (almost twice the space compared to the old phone, maybe it leaves a lot of temp data) I don't know if I either messed with the app-switching or it really finished, but then I got prompted to the screen where you enter your name or nickname. And when I completed this step, I finally got to the chats screen and everything was like in the old phone! Where previously I would get to a lot of empty chat rooms with maybe 40 total messages restored according to WA. Hurray!

Notice that in my case it was still reporting 31% on the WA background screen under the progress bar popup when it finished!! so it seems that is not really mandatory to experience the 100% complete to have it work in the end, but YMMV.

OK, maybe not the most elegant "guide" out there but I wrote it in a hurry and my english sucks, I just hope it might help someone to not lose their WA chats forever.

Good luck!

Edit: I almost forgot but, for the sake of completeness. I also tried a certain script that can backup WA from the phone and retrieve the encryption key, it will also leave an unencrypted copy of the chats database that can later be viewed with a WhatsApp viewer like this. The script is called WhatsApp Key/DB Extractor, and it still works as of 2019, just look at the latest posts in the thread. Guys here on XDA most likely know about it but if not, you might give it a try. I tried it because I assumed that maybe I could circumvent the restore issues by going that route and pushing the backup via ADB, but turns out the legacy WA won't prepare the database due to the time out of sync issue, or at least the data seemed to be lost after performing the restore process, and the unencrypted database on the PC cannot be digested by WA latest versions by just putting it into the internal storage directly according to what other users commented. But, if you finally give up trying the restore process, it still could be relieving to know that you keep a local copy in the PC that can be viewed with another PC tool, at least you get a backup and the conversations are there, in a different way though. Maybe in the future there's a process that can restore them again to a different phone, and you could then merge the new chat database with the older backup with tools like Merjeapp.