Exporting private Slack history: notes for my future self

For a little more than a year now, a small group of WordPress contributors have been working really hard on exploring how the project can use of the Matrix project to replace Slack for project related communication. The team working on this project was able to transfer all public communication in channels. But because of the sensitive nature of direct messages and private group chats, there was no way for them to migrate these into Matrix (or at least they chose not to). So I wanted to find a way to export my private Slack history for archival purposes.

If you’re unfamiliar, “Matrix is an open protocol for decentralised, secure communications.” Changing the way 47,000+ people communicate is no easy task, especially when everyone has become very comfortable with the current tool over the last 10 years. An ambitious goal to switch everyone over by the end of 2023 was announced in November, so I switched to using Matrix 100% and started putting some more thought into what that meant for me and my daily habits/routines.

As someone who is sponsored to contribute to WordPress full-time, I use Slack ALOT. Because I’ve been involved with the community for so long, preserving my private messages is important to me.

As much as possible, I communicate in public channels. But a non-zero amount of my communication is in private DMs. Some of the information in these private messages I refer to frequently for guidance or historical context, and I wanted to explore a way to preserve them for future reference. There were some browser add-ons suggested by the team, but I found they did not work or only exported the last 20-40 messages per DM.

Ultimately, the plan to complete the transition in 2023 was announced as paused at the 2023 State of the Word address, but I wanted to document my findings for my future self for when the time does come to retire my WordPress.org Slack account.

Slack Dumper

After ruling out the suggested browser add-ons, I came across a tool called Slack Dumper on GitHub. The tool allows you to dump, export, or list channels or conversations from your Slack instance. This solved the first part of the problem, extracting your history from Slack.

The tool has a guided step by step walk through in the CLI, and a pretty detailed user guide. The first time you use it, it will download Chromium and you’ll need to authenticate with Slack. This will allow the tool to communicate with the service as you and view your private messages. Because the instance is quite large with a lot of history, it can take a long time for the tool to fetch and cache the manifests that it needs locally.

Grab a channel list to export

To make the best use of the tool, you’ll need to determine a list of conversations to export. Otherwise, (I believe) the entire Slack instance will be exported. I was curious, so I did perform a full export (without attachments). It took over 28 hours.

slackdump -list-channels

The output will look something like this:

2021/10/31 17:32:34 initializing...
2021/10/31 17:32:35 retrieving data...
2021/10/31 17:32:35 done
ID           Arch  Saved  What
CHXXXXXXX    -     -      #announcements
CHXXXXXXX    -     -      #core
CHXXXXXXX    -     -      #random
DHMAXXXXX    -     -      @chanthaboune
DNF3XXXXX    -     -      @matt
DLY4XXXXX    -     -      @jorbin

There are a few letters you’ll see starting conversation IDs:

  • C indicates a public channels
  • D indicates a private message.
  • G indicates a group message (also private).

Based on my screen buffer settings, the entire result wasn’t viewable within my terminal, so I added > channel-list.txt to the command above and dumped the output into a text file. From there, I removed all of the public channels, and isolated the ID column for only the DMs and groups.

Perform the private Slack history export

The last step is to actually perform the export of private Slack history.

slackdump -export all-private-dms.zip @all-dms-and-groups.txt -download

With the command above, an all-private-dms zip file will be created and all channels listed in the all-dms-and-groups.txt file will be exported. The export destination can also be a directory to skip the need to unzip. The -download flag tells it to also download files shared.

Viewing your private Slack history export

The second part of the problem is being able to view and search your exported conversation history. The export creates JSON files that Slack knows how to read, but they’re not very readable by humans, and not that helpful.

For this, I found a tool called Slack Export Viewer. You do need to use pip or pipx to install this one.

After it’s installed, the usage is fairly straightforward. You just pass the directory or location of the zip file created in the previous steps and it handles the rest!

slack-export-viewer -z all-private-dms.zip

This will open a window in your browser with the a local environment displaying all of your exported messages.

Summary

If the cut over had happened as planned, this would likely have been my plan to preserve my private interactions. Hopefully when the time does come to leave Slack for WordPress communication, these tools still exist and work. They do seem pretty well maintained.

Have you explored exporting your private Slack history? What tools did you find worked best for you? Share your process in the comments!

I had planned to write this before the holiday break, but my schedule quickly filled up and this became a “2024 problem”. Blogging more has long been a goal of mine, but I often get paralyzed by an idea not being fully fleshed out or the idea that every post needs to be long form.

I was finally motivated to write this specific by Matt’s request for people to blog for his 40th birthday. I’m hoping to make 2024 the year that I finally start blogging more. This is part of my gift to him!

Long live the blog!

Bloggers throughout the universe
Fediverse Reactions

Discover more from Jonathan Desrosiers

Subscribe to get the latest posts sent to your email.

Responses

  1. Jeff Golenski Avatar

    This is actually very helpful. Thanks Jonny. I always have a concern about work and communication created in proprietary services. Take for instance, InVisions shutdown announcement this past week.

    Always keeping doors open to transfer work in case of companies going under, or just a general switch of services, is important.

  2. Mary Beth Avatar
    Mary Beth

    Super insightful as I’ve always worried about losing years of my own personal notes stored in Slack. Good to know!

Leave a Reply

Your email address will not be published. Required fields are marked *

To respond on your own website, enter the URL of your response which should contain a link to this post’s permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post’s URL again. (Find out more about Webmentions.)