Mikey Beck
← All posts

Slack backup/export tool

October 9, 2016

Do you use slack? Course you (probably) do! Many of my clients are on Slack, and that’s great for me as it works well and is really easy to use.

The problem I have with it is that most of my clients use the free version only, in which the history is limited to 10,000 messages across the team. This sounds like a lot (and it is), but at some point you’re going to run over that limit and the old messages aren’t going to be accessible any more.

It’s a real pain to try searching for some information you’re pretty sure was shared over Slack, only it was some time ago, and the message history only goes back so far…

I’ve come across this problem a few times, and it’s never been a huge issue, but I’m sure at some point this is going to be a huge pain. So I tried out a few of the slack export tools available on Github (user github3332 posted a list here) and got one working.

While I really like the Python ones, none of them seem to export to the standard Slack format, so unless they contain in-built viewing functionality (none of them do) they are pretty useless if you want to view your messages all nicely formatted.

I ended up going with https://github.com/humor4fun/slack-backup. It requires PHP, nodejs & npm, this php script, and makes use of the slack-history-export npm package. I modified the PHP script a little to fix the username bug, and added the ability to reverse the message order.

The benefit of this script is that it doesn’t require admin access to the Slack team, so anyone on the team can export the entire message history, even if they don’t have standard export privileges.

Here’s my version of the modified Slack export script. When the export is complete, you can find the messages in HTML format in the slack2html/html directory.

If the script doesn’t work, check the logs in the _debug folder.

If I have the time, I hope to modify it to update the same set of data, so as long as you run the backup periodically, you can have a single complete history of all your messages!