Skip to content

Use Tyrrrz/DiscordChatExporter to export only new messages in channels, threads or forums

Notifications You must be signed in to change notification settings

zyradyl/DiscordChatExporter-incrementalBackup

 
 

Repository files navigation

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)

  1. Install .NET 7.0 runtime by following this guide
  2. Download DiscordChatExporter.Cli.zip v2.41 or newer from Tyrrrz/DiscordChatExporter/releases
  3. Download release (DiscordChatExporter-incrementalBackup-vX.X.X-win.zip) of this project from slatinsky/DiscordChatExporter-incrementalBackup/releases
  4. Download DiscordChatExporter-frontend-vX.X.X-win.zip from slatinsky/DiscordChatExporter-frontend/releases
  5. create new empty folder
  6. Copy dcef.exe and dcef/ folder from DiscordChatExporter-frontend-vX.X.X-win.zip archive to the root of new folder
  7. Copy backup.exe from DiscordChatExporter-incrementalBackup-vX.X.X-win.zip archive to the root of new folder
  8. Create dce/ folder if it doesn't exist
  9. Unzip contents of DiscordChatExporter.Cli.zip to dce/ folder.
  10. rename config.example.json to config.json

Directory structure should look like this:

dce/
    ...
    DiscordChatExporter.Cli.exe
    ...

dcef/
    backend/
        ...

    frontend/
        ...

backup.exe
config.json
dcef.exe
  1. Get your discord token by following this guide
  2. enable developer mode in discord in settings -> advanced -> developer mode
  3. right click on the server icon you want to backup and select Copy ID
  4. 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)

  1. run backup.exe and wait for it to finish. Your exports will be in exports folder.
  2. 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 token
  • tokens.token - your discord token
  • guilds.tokenName - your name for the discord token defined in tokens.name
  • guilds.guildId - the id of the guild you want to backup
  • guilds.guildName - name of the folder where the guild will be saved
  • guilds.enabled - if true, the guild will be backed up

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 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

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!

About

Use Tyrrrz/DiscordChatExporter to export only new messages in channels, threads or forums

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%