Awesome
Incremental discord backups
Simple wrapper for Tyrrrz/DiscordChatExporter to make incremental backups of Discord channels, including threads and forum posts to be viewed in slatinsky/DiscordChatExporter-frontend
How to archive discord servers incrementally (Windows)
- Install .NET 7.0 runtime by following this guide
- Download
DiscordChatExporter.Cli.zip
v2.41 or newer from Tyrrrz/DiscordChatExporter/releases - Download release (
DiscordChatExporter-incrementalBackup-vX.X.X-win.zip
) of this project from slatinsky/DiscordChatExporter-incrementalBackup/releases - Download
DiscordChatExporter-frontend-vX.X.X-win.zip
from slatinsky/DiscordChatExporter-frontend/releases - create new empty folder
- Copy
dcef.exe
anddcef/
folder fromDiscordChatExporter-frontend-vX.X.X-win.zip
archive to the root of new folder - Copy
backup.exe
fromDiscordChatExporter-incrementalBackup-vX.X.X-win.zip
archive to the root of new folder - Create
dce/
folder if it doesn't exist - Unzip contents of
DiscordChatExporter.Cli.zip
todce/
folder. - rename
config.example.json
toconfig.json
Directory structure should look like this:
dce/
...
DiscordChatExporter.Cli.exe
...
dcef/
backend/
...
frontend/
...
backup.exe
config.json
dcef.exe
- Get your discord token by following this guide
- enable developer mode in discord in settings -> advanced -> developer mode
- right click on the server icon you want to backup and select
Copy ID
- Edit
config.json
in your favorite text editor and fill in your discord token and guild ids
Example:
- my discord token is
bXlzZWNyZXRkaXNjb3JkdG9rZW4=
- server id I want to back up is
123456789012345678
- I want to export dms (use
@me
as server id)
config.json will look like this:
{
"tokens": [
{
"name": "mytoken",
"value": "bXlzZWNyZXRkaXNjb3JkdG9rZW4"
}
],
"guilds": [
{
"tokenName": "mytoken",
"guildId": "123456789012345678",
"guildName": "guild-name",
"enabled": true,
"throttleHours": 23.5
},
{
"tokenName": "mytoken",
"guildId": "@me",
"guildName": "mytoken-dms",
"enabled": true,
"throttleHours": 3
}
]
}
(try not to use special characters in guildName
not allowed in file names)
- run
backup.exe
and wait for it to finish. Your exports will be inexports
folder. - run
dcef.exe
to browse your exports
Next time you want to back up your guilds, just run backup.exe
again. It will only export messages that were sent after the last export.
You can also schedule backup.exe
to run periodically using Windows Task Scheduler.
Configuration file
tokens.name
- your name for the discord tokentokens.token
- your discord tokenguilds.tokenName
- your name for the discord token defined intokens.name
guilds.guildId
- the id of the guild you want to backupguilds.guildName
- name of the folder where the guild will be savedguilds.enabled
- if true, the guild will be backed upguilds.throttleHours
- minimum time between backups in hours. Set to 0 to backup every time the script is run.
How it works
The script will call DiscordChatExporter.Cli
according to configuration file config.json
. Start time of the export is saved in exports/metadata.json
, so the next time the script is run, it will only export messages that were sent after the last export. The script will also export threads and forum posts.
Running from source (Linux)
You need to have Python 3.11, git and text editor (nano/vi/vim) installed. There are no external Python dependencies needed to run this script.
# install docker (if needed) and pull latest stable DiscordChatExporter image
sudo apt install docker.io -y
docker pull tyrrrz/discordchatexporter:stable
# test if the image works (it should print the help message)
docker run --rm tyrrrz/discordchatexporter:stable
# download the backup script repository
git clone https://github.com/slatinsky/DiscordChatExporter-incrementalBackup
cd DiscordChatExporter-incrementalBackup
# copy sample config and edit it (add your token and guild you want to backup)
cp config.example.json config.json
nano config.json
# run the script
python3 backup.py
License
GNU GENERAL PUBLIC LICENSE
Contributing
Feel free to open issues and pull requests.
If you find this project useful, give it a star ⭐. Thank you!