Skip to content

Commit 79c4ecb

Browse files
committed
WAToAndroid (1.0) -> WhatsApp Migration Tools (2.0)
1 parent 788927f commit 79c4ecb

23 files changed

+2058
-38
lines changed

README.md

+82-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,87 @@
1-
# WAToAndroid
1+
# WhatsApp Migration Tools
22

3-
This python script is my own attempt to move my WhatsApp messages, as I needed a quick but custom way to move my messages and calls to a new phone.
3+
WhatsApp migration tools are my own set of utilities and documentation for moving WhatsApp databases from Windows Phone to Android, as well as a comprenhensive description of the 'forensics' involved in manipulating WhatsApp databases.
44

5-
There are methods explained all over the internet on how to get access to data in WP, check [this link](https://www.winwazzapmigrator.com/faq/windows-how-extract-messagesdb) for example.
5+
Previously known as [WAToAndroid](https://github.com/ferferga/WhatsAppMigrationTools/blob/1.0/README.md), I added one more tool and detailed instructions on how to successfully have a working setup after running my scripts (which I hope that will be really useful now, just after the dead of WhatsApp and WP)
66

7-
This script lacks the ability to encrypt the database, as I was unable to get the way WhatsApp encrypts their databases using a Google's account. This means that this script
8-
might be competely obsolete in the recent WhatsApp versions. Thus, this script is provided AS IS, there will be no further updates or support from my side, as it already served for my purposes
9-
and WhatsApp is changing their databases very quickly.
7+
My tools are different from others like [Whapa](https://github.com/B16f00t/whapa), as mine are designed to merge WP databases, which aren't covered in many other third-party tools.
108

11-
## Credits
9+
### A bit of background
1210

13-
You are free to use this script and modify it as you want, but please, give credits if a function or a piece of my code in this software is used in any of your projects.
11+
(Read the original description before reading this [here](https://github.com/ferferga/WhatsAppMigrationTools/blob/1.0/README.md), for even a better *background* =P)
12+
13+
Even though I said that this repository wouldn't receive any further updates, some other complications arose after publishing it.
14+
15+
The original script was written between the middle and near the end of 2018, as I was already looking into switching back to Android after some years with my Lumia 640 XL, and also wanted to have another useful project in hands for learning.
16+
I tested restoring the resulting DB in an spare Android phone I got and it was a success back then.
17+
18+
However, I got a new phone just at the end of January 2019. I tried my own script without success, as WhatsApp already changed the way the restore process works,
19+
not allowing local unencrypted backups to be restored. As I already had everything moved over to my new phone (confident that it would work), I was in a rush to get WhatsApp moved over as well. I discovered then ``WinWazzapMigrator``
20+
an app made by *Nicola Beghin* (who seems that had the same problem I had and wanted to solve it) that served me perfectly. As my script proved to be useless, around that date, I decided to upload it here for people who might find it useful anyway (although it was already probably useless for everyone, not just me).
21+
22+
However, during this 2019 year, I discovered some issues with WinWazzapMigrator that really annoyed me:
23+
24+
* There was a starred message that crashed the app everytime I opened the 'Starred messages' section of the app.
25+
* Messages quotes and mentions were completely away.
26+
* All the call logs were missing
27+
* I decided to not carry media over to the import, in order to save some space. However, even if I wouldn't be able to download them again (because WhatsApp couldn't locate them in the internal storage of my phone) I thought that WinWazzapMigrator would carry over the blurry thumbnails (example below) and placeholders for voice notes and all the media.
28+
29+
<p align="center">
30+
<img src="https://github.com/ferferga/WhatsAppMigrationTools/raw/master/images/blurred_media.jpg">
31+
</p>
32+
33+
All these problems led me to many of my conversations lacking any sense. Also, I became aware afterwards that I could simply use a rooted Android system to access WhatsApp data. I started to investigate around this and I finally decided to write another tool to fix those quirks and merge both databases.
34+
35+
## Project structure
36+
37+
A brief description of the folders included in this repository:
38+
* apk: This folder contains ``WhatsApp 2.18.248`` apk's, as they are known to be the last version where WhatsApp allowed the restore of local encrypted/unencrypted backups. This might be useful if you are moving from WP to Android directly without using WinWazzapMigrator.
39+
40+
* converter: This folder contains the old ``WindowsToAndroidWhatsApp`` (renamed to ``WPWhatsAppToAndroid`` + some tiny changes from last commit for simplifying the job to the ``merger.py`` script). This script will convert your Windows Phone databases to the old schema used in Android databases.
41+
42+
* images: Just images for the documentation
43+
44+
* merger: This folder contains the script that will merge your old WP database with an existing Android database (created by the WhatsApp app in Android).
45+
46+
* samples: This folder contains sample databases of each type for those aiming to upgrade my script if they stop working (if that's the case, please, make a PR!) or for other research purposes.
47+
48+
* LICENSE: Licensing information of this repository. This project is licensed under GPL3.
49+
50+
* requirements.txt: Being Python scripts, my script requires one module that you need to install before. If you're not under Windows, run ``pip install -r requirements.txt`` in your system to install the required module.
51+
52+
If you're a Windows user (or another OS user that needs bytecode Python for some reason), under the [Releases tab](https://github.com/ferferga/WhatsAppMigrationTools/releases) you will find pre-compiled Windows executables. Just extract them and run. No hassle.
53+
54+
## What do I need?
55+
56+
A clone of this repository made with ``git clone https://github.com/ferferga/WhatsAppMigrationTools`` and basic-intermediate computer knowledge (Please, if you think you get stuck during the process due to your knowledge, google a bit first, as the answer to your question might be out there already! That way, I would be able to help better and faster when needed)
57+
58+
## Where do I start?
59+
60+
Start first using the converter script called 'WPWhatsAppToAndroid', check over [here](https://github.com/ferferga/WhatsAppMigrationTools/blob/master/converter/README.md)!
61+
62+
## Is this for me?
63+
64+
This might be what you are looking for if:
65+
66+
* **You did use WinWazzapMigrator to move from WP to Android**: This is what I did, and what was tested
67+
68+
* **You moved to Android starting from scratch there a while ago, and now you want to bring back all your old WP messages to your current WhatsApp installation.**: This will likely be successful, although it wasn't tested.
69+
70+
* **You still didn't move from WP and don't want to buy WinWazzapMigrator**: My process is much more difficult and less user-friendly than theirs, but it will likely succeed as well, although it isn't tested. I would say however that this has less chances of being successful than the 2nd case. But worth trying I suppose, you will learn a lot along the way :).
71+
72+
If you see that any of the examples fits you, take a look anyway, as there are some things (like the *sorting database* part of the merger script) that can be helpful.
73+
74+
# DISCLAIMER
75+
76+
All of these tools and information provided here are intended for educational purposes and only in good faith. I don't encourage anyone, in any way, to try these methods to modify or extract databases of other people. Also, I **don't take any responsibility of what could happen when you use this information or tools I provide**
77+
78+
Although I will try and do my best to help you in case something goes wrong, WhatsApp changes databases very quickly (even if they don't end up implementing many of the features they start to code) and I might not be able to tell you how to solve an specific problem (specially because it might be caused by WinWazzapMigrator, if you used it before, instead of my scripts). So, **ALWAYS KEEP BACKUPS OF ABSOLUTELY EVERYTHING!**
79+
80+
# Credits
81+
82+
You are free to use this script and modify it as you want, but please, give credits if it you use any part of this work in yours. Also, if you improved something, don't hesitate to make a Pull Request!.
83+
If you're coming for a press, it's always great to get people from other sources coming to the repository and give their feedback on your original work, so please link to this as well if you make an article of this.
84+
85+
Everything that you have here is a product of countless hours (across many months)for researching, testing and writing the documentation, so I appreciate all of this.
86+
87+
Thank you very much!

apk/README.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# WhatsApp APK
2+
3+
During all my research in ways in accessing crypted databases, I found
4+
some websites claiming that the latest version that supports restoring local backups with and without encryption (like the ones generated by the main 'WPWhatsAppToAndroid' script)
5+
is ``2.18.248``.
6+
7+
Here you can find all the APK variants from that version, directly downloaded from APKMirror. They will be useful for you if you want to try to restore the
8+
android database generated by my 'WPWhatsAppToAndroid' script (although I'm still unsure if it works). You shouldn't need them if you follow my new instructions, but here they are, just in case if useful for another backup or something else.
9+
10+
As always with software from unkown sources around the internet, use it at your own risk and take the proper saftey measures.
11+
I didn't checked, neither used them, so you've been warned.
12+
13+
## Troubleshooting
14+
15+
If you're from far away from the future, maybe, after installing it you will be welcomed with a message saying that the version you have installed is expired.
16+
Change the date of your device to a date near August of 2018 (the date when this version was released). After doing this, you should be able to make a backup and go to a newer version
30.5 MB
Binary file not shown.
30.3 MB
Binary file not shown.

apk/whatsapp_2.18.248_x86-nodpi.apk

30.5 MB
Binary file not shown.
30.6 MB
Binary file not shown.

converter/README.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# WPWhatsAppToAndroid
2+
3+
This script will convert your existing Windows Phone's WhatsApp database to
4+
the Android's schema.
5+
6+
## What do I need?
7+
8+
You need two databases: **messages.db** and **calls.db**, which you can get
9+
using this [nice tutorial](https://www.winwazzapmigrator.com/faq/windows-how-extract-messagesdb) from WinWazzapMigrator.
10+
11+
**calls.db** is not mentioned anywhere in the tutorial (as WinWazzapMigrator doesn't move them), however, it's located in **messages.db**'s directory, so you will spot it easily.
12+
13+
## Before starting
14+
15+
* **Windows users**: Download [here](https://github.com/ferferga/WhatsAppMigrationTools/releases) the latest available release.
16+
17+
* **Unix users**: Clone this repository and install the requirements as specified in the main 'README.md' file.
18+
19+
**ATTENTION!:** There are some part of the code designed to work only with Spain's phone numbers, so my contry code is used (+34). Go to lines **282**, **334** and **335** and change *34* with the phone code of your country. If you have contacts from other countries, you might need to do further changes to the code.
20+
21+
Also, take a look at lines **342** and **344**. There, (I'm not sure, as I never had my hand on a non-spanish database) I suspect that the ``s`` letter stands for 'Spain'.
22+
23+
Open first your database with [SQLite Database Browser](https://sqlitebrowser.org/) and check the 'Jid' column in 'JidInfo' table to see how your contacts jids are stored.
24+
Most of the records in that table should be something like [email protected] (being **X** your country code, **Y** the phone number of your contact, and **z**). Ignore the rest, only pay attention to those that ends on ``@z.whatsapp.net``
25+
26+
Replace the ``s`` letter in the lines mentioned above if your **z** is different than ``s``.
27+
28+
Any PR to make this script easier to 'globalize' is appreciated!
29+
30+
(Of course, changing the lines in the code means that Windows users will need to run the script from its source, with Pyhton installed in their systems)
31+
32+
## Instructions
33+
34+
The process is really straightforward, everything is explained inside the script, so just follow the instructions.
35+
36+
After finishing, **don't remove any of the files**, you will need them later.
37+
38+
## Done! What's the next step?
39+
40+
Go over [here](https://github.com/ferferga/WhatsAppMigrationTools/blob/master/merger/README.md)!
41+
42+
## Issues
43+
44+
If facing any issues, publish the exception code received. For seeing it, just reproduce what you were doing again in a cmd or bash terminal, executing the script from there (instead of double clicking on it in the file browser), as the script might simply crash.
45+
46+
**IF YOU FACE AN ERROR, YOU ARE SUGGESTED TO NOT USE THE RESULTING *MSGSTORE.DB* DATABASE IN ANY OF THE FOLLOWING STEPS, AS YOU MIGHT END UP WITH AN INCOMPLETE OR INCOHERENT DATABASE**

0 commit comments

Comments
 (0)