pR0Ps / slack-to-discord

Import a Slack export into a Discord server
https://pypi.org/project/slack-to-discord/
76 stars 11 forks source link

Improve migration process for large files #33

Open pR0Ps opened 3 months ago

pR0Ps commented 3 months ago

According to a recent email from Slack:

Free workspace content older than one year will be deleted

Since there are size restrictions on data uploaded to Discord, the bot currently "imports" large files by uploading a thumbnail and linking to the original Slack-hosted file. If Slack is deleting old content, these links are probably going to expire as well.

Without finding somewhere else to host this data, the best case is that the data is downloaded locally so at least it's not lost. This could be done by providing another CLI entry point in this package that just downloads the data.

However, since just downloading the data doesn't solve the issue of the URL no longer working, ideally there would be some way to link to a non-Slack-hosted backup of this data instead. This would ensure that organizations that want to ensure that the data is preserved can download the data, host it somewhere, and have the import process generate links to those URLs instead.

Maybe something like:

slack-to-discord --zipfile <slack export zip> --external-filehost "https://some-bucket.s3.amazonaws.com/"

Which would convert the URLs like https://files.slack.com/files-pri/XXXXXX-YYYYYY/some-file.ext to https://some-bucket.s3.amazonaws.com/XXXXXX-YYYYYY/some-file.ext when linking them.

dib258 commented 2 months ago

Hello, I created such a script (in PHP) to achieve this.

https://gist.github.com/dib258/de3c006794c99fb0ad728d922005cada

Before knowing we were going to migrate to discord and find this wonderful script (Thanks @pR0Ps for your work!)

we wanted to save all of our files locally.

This script achieve exactly and only this.

Hope this helps ;)