Whatsapp chat import into Mattermost

Is it possible to import an existing Whatsapp chat with messages and documents into a channel of Mattermost? How I could do that?

André

It is possible to export a Whatsapp-Chat with media into a filesystem. The chat is a text file, so you can parse the file and build JsonL format from that for a Mattermost bulk loading file, which contains all Whatsapp posts as Mattermost Post objects:

https://docs.mattermost.com/onboard/bulk-loading-data.html#post-object

You have to translate the timestamp, and the emojis. I have post single emojis to a chat and then you can export the chat and lookup for the Unicode characters of the emoji, which you have to translate into Mattermost :emoji-name: strings.

Then map the user names from Whatsapp chat into Mattermost user names and add all the users to the Mattermost destination channel.

Now you can choose a team name and a destination channel name and insert these data into the Post object too. An additional Version object is also needed on top of the JsonL file:

https://docs.mattermost.com/onboard/bulk-loading-data.html#version-object

Correct the attachment file names (must be absolute path names on the Mattermost server) within the Post object. The mattermost user must have access to these files.

After that, you can run the bulk loading command:

https://docs.mattermost.com/onboard/bulk-loading-data.html#running-the-bulk-loading-command

At the end, I have hundreds of new posts with the right timestamp on the new Mattermost channel, inclusive media (like JPG).

2 Likes

PHP-Tool to convert Whatsapp chats into Mattermost channel posts.