Great news!
There is now an official method to migrate WhatsApp from Android to iOS. This new guide can be found here.
This official method will be the best option for the majority of users. There are a few limitations:
The below guide will stay up incase you run into issues with the official tool, but will go without updates as I do not have a second phone and phone number to keep resetting my phone to test the tools.
Info below was current as of December 2021. Please read the whole guide before performing any steps. The exact syntax of many of the tools has changed since then and so has the format of the encrypted whatsapp files. See the github pages for each tool for the updated syntax, but the overall steps remain unchanged.
As per the issues on this repo there may be some issues with backing up via an android emulator or with rooted systems where care has not been taken to hide the root status. It would appear that WhatsApp are actively trying to block these workarounds.
This is a guide to migrating WhatsApp messages from Android to iOS using open source software for free.
Currently no official method exists for migrating historical messages in WhatsApp when moving from an android to iOS device.
There is an official method for migrating from iOS to Samsung android phones using Samsung's SmartSwitch utility. Android > iOS is apparently a work in progress for the WhatsApp team but there is no ETA provided.
3rd party utilities exist to migrate WhatsApp messages from Android to iOS such as Dr. Fone, MobileTrans, Mobitrix, BackupTrans however these are all paid solutions, closed source, and have ambiguous privacy policies that mean these tools cannot be trusted that they are not exporting whole copies of your messages.
The steps below go through getting the decrypted message database from an android device through backing up an iPhone locally, modifying the whatsapp backup and restoring the backup to the iOS device.
<Image>
messageThe message database is user accessible on android but encrypted with AES-256. The encryption key for WhatsApp is stored with in a protected portion on the android device. This key is created at install and is calculated based on your phone number (therefore does not change between installations).
a. If your android device is rooted, connect to pc and run the following
mkdir WhatsApp-Migration
cd WhatsApp-Migration
adb root
adb pull /sdcard/Android/media/com.WhatsApp/WhatsApp/Databases/msgstore.db.crypt14
adb pull /data/data/com.WhatsApp/files/key
adb pull /data/data/com.WhatsApp/databases/wa.db
b. If your Android device is not rooted (method 1 - using old WhatsApp APK)
try this guide here, however i did not have any success with it
c. If your Android device is not rooted (method 2 - Using Android Emulator)
root
Perform from within the same directory as your msgstore.db.crypt14 and key.
pip install protobuf pycryptodomex
git clone https://github.com/ElDavoo/WhatsApp-Crypt14-Decrypter
python3 ./WhatsApp-Crypt14-Decrypter/decrypt14.py key msgstore.db.crypt14 msgstore.db
rm -rf WhatsApp-Crypt14-Decrypter
mkdir original-files
mv msgstore.db.crypt14 original-files
mv wa.db original-files
mv key original-files
Recent versions of iTunes on macOS don't have an option for local backup. Either install an older version of iTunes or use the Apple Configurator 2 App to backup. Backups can be created on macOS or Windows with iTunes but all further steps need to be done on macOS.
%APPDATA%\Apple Computer\MobileSync\Backup
to ~/Library/Application\ Support/MobileSync/Backup
on macOSgit clone https://github.com/residentsummer/watoi
watoi/scripts/bedit.sh list-backups
export BACKUP_ID="put ID of the backup here" # use the latest ID from the list-backups command
cp -R ~/Library/Application\ Support/MobileSync/Backup/${BACKUP_ID} original-backup
You will need a copy of WhatsApp.ipa of same version you have on your device. You can get this from the internet or following this guide to obtain via Apple Configurator 2, the steps of which are summarised below.
~/Library/Group Containers/K36BKF7T3D.group.com.apple.configurator/Library/Caches/Assets/TemporaryItems/MobileApps/
to your working directoryunzip ./Whatsapp.ipa -d app
The commands below extract the message files from the backup and important manifest files.
export ORIGINALS="originals/$(date +%s)"
mkdir -p $ORIGINALS
watoi/scripts/bedit.sh extract-chats $BACKUP_ID $ORIGINALS/ChatStorage.sqlite
watoi/scripts/bedit.sh extract-blob $BACKUP_ID Manifest.db $ORIGINALS/Manifest.db
cp $ORIGINALS/ChatStorage.sqlite ./ChatStorage.sqlite
xcodebuild -project watoi/watoi.xcodeproj -target watoi
watoi/build/Release/watoi msgstore.db ./ChatStorage.sqlite app/Payload/WhatsApp.app/Frameworks/Core.framework/WhatsAppChat.momd
scripts/bedit.sh replace-chats $BACKUP_ID ./ChatStorage.sqlite
Restore the backup with iTunes/Apple Configurator 2.
Note for virtual machine users: I had considerable issues getting my iPhone to be detected by Apple Configurator 2 when restoring the backup. Apple Configurator was stating my device was already provisioned and then not detecting the device at all after a factory restore. I created a backup using iTunes in Windows, transferred this to the VM using a shared folder. Once the backup was modified i transferred the backup to Windows again and restored with iTunes.
Browse your msgstore.db file on your pc with whatsapp-viewer if you need to view these at a later date or just have no success in patching the iPhone backup and just want a way to see the messages.
Using the wa.db file will show contact names along with the messages.
This guide uses these fantastic tools:
Also was inspired by these guides:
I had also tried these tools but could not get them to work - your milage may vary:
data/data/com.whatsapp/files/key
/sdcard/Android/media/com.whatsapp/
%APPDATA%\Apple Computer\MobileSync\Backup
~/Library/Group Containers/K36BKF7T3D.group.com.apple.configurator/Library/Caches/Assets/TemporaryItems/MobileApps/
All of the above steps are at your own risk. This is a fiddly process and took me many attempts. Make sure you make backups along the way, i take no responsibility if you lose data performing any of these steps.
This guide is provided under the GPLv3 License.
All tools used are provided under their own license terms check the project pages for details.
Copyright (C) 2021 needs-coffee
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.