You can jump straight to the steps here.
Recently I bought my first ever iPhone, and wanted to transfer everything from my (not so) old Android phone. I tried to transfer WhatsApp chats over from my Android phone to iOS, using the official Move to iOS app by Apple.
However, no matter how many times I tried this approach, I would get to the “Preparing” screen, and always get stuck at the same exact percentage (86% for me).
Note
This guide will probably only work for you if and only if your transfer also fails in the same way: at the “Preparing” screen, and at the same percentage always (doesn’t need to be 86%, and it can move if you delete some chats or send/receive more messages).
I looked up similar issues online, where I found some suggestions:
- Use WhatsApp Beta.
- Remove SIM card from the phone when it gets to preparing.
- Reboot both phones.
- Use a cable instead of WiFi, or vice-versa
However, these didn’t end up working for me.
Note
Some things I tried:
- The latest WhatsApp beta.
- The WhatsApp beta from around the time of the posts/comments (when it worked for some users) from APKMirror.
- Interestingly, WhatsApp APKs have a check on the date (only valid for 45 days from release/build), but I figured out that it could be skipped by just changing the date on my phone and reinstalling the app.
One thing I noticed over the course of some ~30 attempts is that it always failed at the same percentage. I suspected that this may be due to a particular message that might be corrupted in some way, and so I started clearing out old chats. This moved the needle a bit (from 86% to 81%) but I was still seeing the same failure.
However, it did give me some confidence in my hypothesis. Turns out, there is a way to get access to the DB used by WhatsApp.
By enabling end-to-end encrypted backups, and choosing the 64 byte hex key option, you can use the generated key (which WhatsApp shows you) to decrypt backups!
By getting this file out using adb, and then decrypting it using wa-crypt-tools , you can find any corrupted messages (at least of the same type that I faced) and delete them manually on your Android device. After you do this, the regular way of transferring works completely perfectly, and you don’t have to resort to any shady 3rd party apps!
Here are the final steps I followed. Note that these assume that you are good at computers, and I hope that others would be able to rewrite these steps (or maybe even make a video/tool) to help the less technically-inclined among us.
- Enable end-to-end encrypted backups on your Android WhatsApp device. Follow the official FAQ here.
- Please note: make sure to select the 64-digit encryption key option, and to note + take photos + screenshots of this key. Without this, you will lose your backups (and I don’t know what more).
- Make sure you take a backup with all your latest chats. Also, from what I know, this will not transfer over call logs, stickers, and maybe some more things. I didn’t really care about call logs, and for stickers I just sent all my stickers to myself BEFORE the backup.
- I suspect this is not strictly necessary, but please just do it.
- Enable developer options and USB debugging on your phone. Search around for instructions on the same.
- Install adb. I am on Ubuntu, so I just ran
sudo apt install adband was good to go. - Connect your phone to your laptop, and then run
adb devices. You should see a popup on your phone asking to trust this computer, enter your PIN and click on Trust (or similar). - You should be able to see one entry in
adb devices. If not, search around and get your phone working withadb(out of scope of this guide). - Copy the DB
adb pull /sdcard/Android/media/com.whatsapp/WhatsApp/Databases/msgstore.db.crypt15. - Now, we need to use wa-crypt-tools to decrypt this file. You need Python for this, I installed uv and ran
uv tool install wa-crypt-toolsto keep things clean, but just a simplepython -m pip install wa-crypt-toolsshould be fine as well. - Create the key file using
wacreatekey --hex 123123123123here. Don’t enter spaces, just enter everything in lowercase. (I don’t know what happens if you enter this wrong, most probably the next step will fail for you. If it does, remove the generated key file and try this step again). - The last step would have created
encrypted_backup.keyfor you. Now decrypt the database:wadecrypt encrypted_backup.key msgstore.db.crypt15 decrypted.db. - Next, open up
decrypted.dbin any SQL tool of your choice (I used DBeaver) and run the following queries to figure out the messages that are corrupted.
-- Find the IDs of the messages that are corrupted.
SELECT _id
FROM message
WHERE message_type = 0 AND text_data IS NULL;
-- For me this gave just a single ID, if it gives you multiple,
-- repeat the remaining steps once per ID.
-- Find the next 20 messages in the same chat.
SELECT text_data
FROM message
WHERE chat_row_id = (SELECT chat_row_id FROM message WHERE _id = <REPLACE_HERE>)
AND "timestamp" >= (SELECT "timestamp" FROM message WHERE _id = <REPLACE_HERE>)
ORDER BY "timestamp" ASC
LIMIT 20;- The above query (or queries) will give you the next 20 messages in the same chat, search for these messages and find the faulty message(s) by scrolling up. In my case, it had a red exclamation icon next to it. I deleted it and the next message (the next message had the text
nullin it somehow) and then tried Move to iOS again, which worked.
Note
One thing I also faced is once I transferred my data over to WhatsApp, it asked me for a verification code on my older phone, but I was already logged out of there. To fix this, simply log into your old phone again (don’t worry, the data will still remain transferred on your iPhone) and then try logging into WhatsApp on your iPhone again. It will now send the code properly to your old phone.
