How to Extract Whatsapp Messages from iPhone Backup

0 Comments
Editor Ratings:
User Ratings:
[Total: 3 Average: 4.3]




This tutorial explains how to extract Whatsapp Messages from iPhone backup. Here I will use a few tools to extract messages from WhatsApp by fetching the Whatsapp message database from iPhone backup that you have on your MAC or MBP. Here I will talk about a Jupyter Notebook which you can use to read WhatsApp messages and then you can do whatever you want to do. Though, it is not very clean method of doing that but at least something is better than nothing. You will also see some other technical aspects of the WhatsApp database backup file that we will use to read messages.

If you already have backed up your iPhone on your MBP or iMAC then it will be very easy to start. Otherwise, I will leave a link which will help you backup your iPhone to MBP using iTunes. You will be able to read all the messages that WhatsApp SQLite file has and will see other things. Also, you can extract the media from the WhatsApp backup if there is any. Media including downloaded photos, videos and stories can extracted with ease. And after you extract that, you can save it or to whatever location you want.

How to Extract Whatsapp Messages from iPhone Backup

How to Extract Whatsapp Messages from iPhone Backup?

Before getting started with the whole process, I would like to let you know what tools we will use in order to achieve this task. The first thing we will need for this is macOS. If you have it then it’s wonderful, otherwise you can set it up in a virtual machine. Next tool we need iExplorer to explore the iPhone backup and extract the WhatsApp database since it cannot be accessed from the raw backup files. And the final tool that needs to be setup on MBP is the Jupyter Notebook. If you know about Jupyter Notebook then it will be very easy to understand the whole process.

If you don’t know about Jupyter Notebook, then you can in brief, it is an interactive Python code that can be run with ease. And in the Notebook apart from the code, there is a documentation for it as well. Which makes it very easy to understand the code and execute it to see the output. There are few Python code in the Notebook which we will use to read the WhatsApp database backup file.

Now, let’s get started with it. For ease, I have divided the whole process of reading WhatsApp messages into two parts. In the first part, we will get the WhatsApp database backup file. And in the second part, we will use the backup file to read the messages.

Part 1: Extracting WhatsApp Database from iPhone Backup

Let’s assume that you periodically backup your phone on your MBP. There will be a backup folder at “~/Library/Application Support/MobileSync/Backup“. You will see numerous files there which will look like some random ones that you can’t just open and read. To read those, you will need some special piece of software. If you don’t have backup store on your MBP then you don’t have to worry. You can do that pretty easily through iTunes. Just connect your phone via USB cable in the device overview, simply hit the backup button. For more details, you can go to this official page of Apple’s website and see yourself.

Iphone backup files

Now, the second thing you have to do is install iExplorer. The free version of this tool will be enough to do the truck. After installing this tool. On the main interface of iExplorer, you go to the iTunes backup and then go to the “” tree. You will see a “ChatsStorage.sqlite” file there. You can see the screenshot below. Right click on it and then select “Export to Folder” option and then save it anywhere you like but remember the location. Under the same tree, there is a folder named “Media” that you can export as well in case you want to access all media.

Whatsapp database file in the backup folder

At this point, the first part finished. You now have a SQLite database file which has various columns which contain a different type of data including WhatsApp messages. And now we will see how to read them from this database file.

Download iExplorer from here

Part 2: Extracting WhatsApp Database from iPhone Backup

Now when you have the database file, it’s time to read it. To read the database file, you will have to set up some tools. If you are a programmer then I am sure they will be already there so you can skip this. Python is already installed on MAC so you just need to execute the following command to install Jupyter Notebook and Pandas.

pip install jupyter pandas

pip install pandas

Now, you get this repository and the copy the “WhatsApp DB Analysis and Conversation Extraction.ipynb” in the same folder where you have kept the WhatsApp database file that is “ChatStorage.sqlite”.

Jupyter file and sqlite file

Enter the following command and then interface of Jupyter Notebook will open in the browser. And if it doesn’t then you can enter localhost:5338 in the address bar of Safari to manually open it. After that, you go to the location where you save the IPYNB file and then open it.

jupyter notebook

Launch jupyter notebook

Now, you have to run the code in the Notebook using the Run button given in the toolbar of the Notebook. And when the first block executes, it will list some awkward looking names which are 18 in my case. You can see them in the screenshot below. These are nothing but the tables in the SQLite database. And the messages are stored in the “ZWMESSAGE” table.

Jupyter notebook produce tables

When you further scroll down where the code is analyzing the “ZWAMESSAGE” table, you will see that it will list some different columns in the output section. There are 34 columns and in the “ZTEXT” column, you will see the actual text present in the database. That’s it, there you will find the text entries that you can read. Based on the size of the database file, the number of messages can be more. Since I had a very few messages in the test iPhone so it only displayed a few messages only. Next to the message text you can see the number of the sender.

Jupyter notebook show messages

In this way, you can extract WhatsApp messages from iPhone backup. All the tools which you will need I have mentioned there and you can use them easily to get the messages. However, this is not only it. There are other experiments you can try on the database file. You can build different queries to extract a specific conversation. But that is for the techie folks. If you are one of them, then you can read the whole story on Medium.

Final thoughts

This is the whole process of extracting WhatsApp messages from iPhone backup. You can follow this post and in the end, you will be able to read almost all the messages. Not only this, you can have access to the WhatsApp media and then you are free to save that. So, if you have an iPhone or old iPhone backup then you can read the conversations in that or do whatever you want.

Editor Ratings:
User Ratings:
[Total: 3 Average: 4.3]
Free/Paid: Free

Leave A Reply

 

Get 100 GB FREE

Provide details to get this offer