Simple wrapper for Tyrrrz/DiscordChatExporter to make incremental backups of Discord channels, including threads and forum posts to be viewed in slatinsky/DiscordChatExporter-frontend
- 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
},
{
"tokenName": "mytoken",
"guildId": "@me",
"guildName": "mytoken-dms",
"enabled": true
}
]
}
(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.
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 up
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.
You need to have node.js v18.17.1+, npm 10.0.0+, git and text editor (nano/vi/vim) installed.
git clone https://github.com/slatinsky/DiscordChatExporter-incrementalBackup
cd DiscordChatExporter-incrementalBackup
cp config.example.json config.json
nano config.json
npm install
node main.js
GNU GENERAL PUBLIC LICENSE
Feel free to open issues and pull requests.
If you find this project useful, give it a star ⭐. Thank you!