All articles
Articles
7 min read

Archiving a Discord server and its chat history

How to archive a Discord server: what the official data request returns, how DiscordChatExporter works, and what every export leaves behind.

On this page

Discord ships no export button for a server, so how to archive a Discord server comes down to two routes and the gap between them. One is a personal data request buried in account settings. The other is a handful of third party tools that talk to the API. Which one you pick decides whether you end up with a community archive or with half a conversation. Both are worth understanding before someone announces the server is closing.

RouteWhat you getWhat it costs you
Discord's data requestYour own messages, plus settings and audit log for servers you ownUp to 30 days of waiting, and nobody else's messages
DiscordChatExporter with a bot tokenEvery channel the bot can read, as HTML, JSON, CSV or textA little setup in the developer portal
DiscordChatExporter with a user tokenThe same exportA breach of Discord's terms and a risk of a ban

Discord's own data request

The official route sits in User Settings under Data & Privacy, called Request Data on desktop and "Request all of my data" on mobile. Discord requires a verified email on the account, processes one request at a time, and states that it can take up to 30 days. The download link goes to whatever email was attached when the request was made, so changing your address afterwards does not redirect it, and deleting the account before the link arrives cancels the request.

The package that comes back is a ZIP with folders Discord documents individually. Account holds your profile, settings, connected accounts and sessions. Messages holds every message you sent, split by direct messages, group chats and server channels, with timestamps, content and attachment links, and with deleted messages excluded. Servers holds, for servers you own, emoji, audit logs, channels, settings and webhooks, and for servers you merely belong to, server details and recent audit log actions. Activity, Activities, Ads and Support Tickets follow, and Discord notes that safety related data under Activity is kept for up to two years.

Read that list with a server owner's eyes. You get your own words and your server's configuration, and nobody else's messages. A request run by the owner of a five year old community returns the audit log, the channel list and the owner's own posts, which adds up to an administrative record and very little conversation. For a personal keepsake it is the right tool and the only one that carries no risk. For preserving a community's knowledge it is not enough on its own.

DiscordChatExporter and the token question

The tool most communities reach for is DiscordChatExporter, an MIT licensed project by Tyrrrz that has been maintained for years. It exports channels to HtmlDark, HtmlLight, PlainText, Json or Csv, with the HTML output self contained and viewable offline. There is a desktop GUI for Windows, macOS and Linux, a cross platform CLI, and a Docker image published as `tyrrrz/discordchatexporter`. The CLI is the one that matters for a whole server: `exportguild` takes a server ID and walks its channels, while `export`, `exportdm`, `exportall`, `channels` and `guilds` cover the narrower cases.

A few options change the result more than the format does:

OptionWhat it does
`--media`Downloads avatars, images and attached files instead of linking to them
`--reuse-media`Skips assets already fetched on a rerun
`--include-threads`Accepts `none`, `active` or `all`, and defaults to leaving threads out entirely
`--partition`Splits output after a message count or a file size such as `20mb`, which keeps HTML files openable
`--after`, `--before`Date bounds
`--filter`Expressions in the style of `from:username has:image`

The threads default is how people end up with an export that quietly misses years of thread discussion.

Then the awkward part. DiscordChatExporter accepts either a user token or a bot token, and its own documentation says plainly that "automating user accounts is against Discord TOS and may result in you getting banned", recommending a bot instead. Discord's terms of service, under restrictions, prohibit "scraping our services without our written consent, including by using any robot, spider, crawler, scraper, or other automatic device, process, or software". A bot token made in the developer portal and invited to your own server with View Channels and Read Message History is the defensible version, and it has a practical advantage too: a bot reads only what its role can read, so the export matches the permissions you granted.

Other tools do narrower jobs. Discord History Tracker pairs a script injected through the browser with a desktop app that stores messages in a local SQLite file and renders a browser viewer, covering servers, groups and direct messages. DiscordChatExporter-frontend puts a searchable, Discord shaped interface over JSON exports. The Data Package Tool by aamiaa browses the official ZIP, which is otherwise a folder of CSV files named after channel IDs.

The gaps in every export

Attachments are the first thing to go. Discord serves attachment URLs signed with `ex`, `is` and `hm` parameters, described in its developer reference as an expiry timestamp, an issue timestamp and a signature, and once the timestamp passes the link is dead. Any archive that stored only links, including the messages folder in the official data package, degrades into a wall of broken images. This is the single strongest argument for `--media` on a real export.

Voice was never recorded, so voice channels, stage events and screen shares leave nothing behind. Threads are absent unless you ask for them. Edit history is gone, and deleted messages are excluded from the official package. Reactions are thin, since the documented feature list covers markdown, attachments, embeds and emoji, with nothing on who reacted with what. Roles and nicknames are captured as they stand at export time, so an old argument loses the context of who held which role during it.

A working order for a server owner

Most servers have three or four channels holding anything worth keeping and a dozen holding greetings, and exporting everything makes the result harder to use and no safer. People wrote those messages expecting a chat window, and a published archive is a different thing from scrollback. With that in mind:

  1. Name the scope and tell members first, with a date, in a channel they read.
  2. Freeze the channels in scope by removing Send Messages, so the export is a snapshot that stops moving.
  3. Create an application in the developer portal and invite the bot with View Channels and Read Message History and nothing else.
  4. Run `exportguild` with `--media`, `--reuse-media` and `--include-threads all`.
  5. Export twice if you can: JSON for anything you might process later, HTML for anything a human reads this year.
  6. Verify. Run `channels` against the server, compare it against the files you produced, and open the oldest and newest exports to check that images resolve from local storage.
  7. Keep two copies in two places, neither of them Discord.
  8. Finish with the official data package, the only way to get the audit log and settings for a server you own.

Keeping the archive readable afterwards

An export is storage. Nobody searches a folder of HTML files, nobody links to them, and they answer no question a member asks next year, which is the quiet way archives die even when the files survive. Communities that get value out of one do a second pass: they pick the twenty conversations members keep referencing, give each a title and a page, and put the conclusion at the top instead of two hundred messages below it.

Chat is chronological and questions are topical, and the cost of an archive sits in that mismatch. That is also the difference between history a search engine can reach and history that lives on one hard drive, so the raw export is usually paired with something searchable, a local viewer over the JSON or a threaded board on the open web. The gap between a backup and a working archive is exactly this, and communities that learned it late, the ones whose boards vanished with the platform, mostly kept fragments.

Do it while the server is alive. The people who wrote the knowledge are the only ones who can say which parts were right.

Start your own forum

Set up a community in a couple of minutes. Free to start, no credit card.

Create your forum