A powerful, self-hosted solution for archiving and exploring Discord server data
DiscordDataMirror is a complete Discord archiving solution that captures, stores, and lets you explore all data from your Discord servers. It runs as a background service, silently recording every message, member, channel, and reaction in real-time — creating a permanent, searchable backup that you fully control.
- Discord has retention limits — Messages can be auto-deleted, and server owners can purge history at any time
- Users delete messages — Important context disappears when people delete their messages
- Servers get deleted — Community history can vanish overnight
- Discord's search is limited — You can't search deleted messages or export your data easily
- Compliance requirements — Some organizations need to archive communications
DiscordDataMirror solves all of these problems by maintaining a complete, independent copy of your Discord data.
Every message is captured the instant it's sent, before it can be deleted or modified. You'll never lose important discussions, announcements, or memories again.
- Real-time capture via Discord's Gateway API
- Preserves message content, embeds, and formatting
- Tracks edits and deletions (original content retained)
- Supports all message types: replies, pins, system messages
- Full attachment metadata (with optional local caching)
Maintain a complete record of everyone who has ever been in your servers.
- User profiles with avatars, usernames, and creation dates
- Guild-specific data: nicknames, roles, join dates
- Join/leave history tracking
- Bot account flagging
The entire server hierarchy is preserved, including ephemeral content.
- All channel types: text, voice, forums, stages, categories
- Thread capture (including auto-archived threads)
- Role hierarchy and permissions
- Channel topics and descriptions
Find any message across all your servers instantly.
- Full-text search powered by PostgreSQL
- Filter by server, channel, user, or date range
- Search deleted messages
- Export search results
A modern, Discord-like interface for browsing your archives.
- Familiar Discord-style message rendering
- Channel browser with message counts
- User activity timelines
- Real-time sync status monitoring
Deploy anywhere with Docker Compose.
docker pull ghcr.io/jerrettdavis/discorddatamirror-bot:latest
docker pull ghcr.io/jerrettdavis/discorddatamirror-dashboard:latestModern cloud-native architecture with built-in observability.
- Automatic service discovery
- Distributed tracing
- Health checks and metrics
- Centralized logging
| Requirement | Version |
|---|---|
| .NET SDK | 10.0+ |
| Docker Desktop | 4.0+ |
| Discord Bot Token | Get one here |
# Clone the repository
git clone https://github.com/JerrettDavis/DiscordDataMirror.git
cd DiscordDataMirror/publish
# Configure environment
cp .env.example .env
# Edit .env with your Discord token and settings
# Start the stack
docker compose up -d# Clone the repository
git clone https://github.com/JerrettDavis/DiscordDataMirror.git
cd DiscordDataMirror
# Configure bot token
./scripts/setup-bot.ps1 # Windows
./scripts/setup-bot.sh # Linux/Mac
# Run with Aspire
cd src/DiscordDataMirror.AppHost
dotnet run- Aspire Dashboard: Open https://localhost:17113 to see all services
- Data Dashboard: Open https://localhost:5001 to browse archived data
- Discord Server: Verify the bot appears online in your server
The bot will begin syncing historical messages in the background. This may take several minutes for large servers.
Dashboard Overview
View all your monitored servers at a glance with message counts, member stats, and sync status.
Channel Browser
Navigate your server's channel structure with Discord-like familiarity. See message counts and quickly jump to any channel.
Message Viewer
Read messages exactly as they appeared in Discord, complete with embeds, reactions, and reply chains.
| Setting | Description | Default |
|---|---|---|
Discord:Token |
Your bot's authentication token | Required |
Discord:SyncOnStartup |
Fetch historical messages on start | true |
Sync:MaxHistoricalMessages |
Max messages per channel to backfill | 10000 |
Attachments:EnableCaching |
Download attachments locally | false |
Discord__Token=your-bot-token
Sync__MaxHistoricalMessages=50000
Attachments__EnableCaching=true📖 See the full configuration reference for all options.
DiscordDataMirror follows Domain-Driven Design and Clean Architecture principles:
┌─────────────────────────────────────────────────┐
│ Presentation │
│ (Dashboard, Bot Worker Service) │
├─────────────────────────────────────────────────┤
│ Application │
│ (Commands, Queries, Handlers, DTOs) │
├─────────────────────────────────────────────────┤
│ Domain │
│ (Entities, Aggregates, Value Objects) │
├─────────────────────────────────────────────────┤
│ Infrastructure │
│ (EF Core, Discord.Net, Repositories) │
└─────────────────────────────────────────────────┘
| Layer | Technology |
|---|---|
| Runtime | .NET 10 |
| Orchestration | Aspire 13.1 |
| Dashboard | Blazor Server + MudBlazor |
| Database | PostgreSQL 17 |
| Discord API | Discord.Net |
| CQRS | MediatR |
| ORM | Entity Framework Core |
📖 See ARCHITECTURE.md for detailed documentation.
DiscordDataMirror/
├── src/
│ ├── DiscordDataMirror.AppHost/ # Aspire orchestrator (start here!)
│ ├── DiscordDataMirror.ServiceDefaults/ # Shared Aspire defaults
│ ├── DiscordDataMirror.Domain/ # Domain layer (entities, events)
│ ├── DiscordDataMirror.Application/ # Application layer (CQRS)
│ ├── DiscordDataMirror.Infrastructure/ # Infrastructure layer (EF, Discord)
│ ├── DiscordDataMirror.Bot/ # Discord bot worker
│ └── DiscordDataMirror.Dashboard/ # Blazor dashboard
├── tests/ # Unit and integration tests
├── docs/ # Documentation (DocFX)
├── scripts/ # Setup and utility scripts
├── publish/ # Docker Compose files
└── README.md
| Document | Description |
|---|---|
| Getting Started | Complete setup walkthrough |
| Features | Detailed feature descriptions |
| Configuration | All configuration options |
| Bot Setup | Discord Developer Portal guide |
| Deployment | Production deployment with Docker |
| Architecture | System design and patterns |
| FAQ | Frequently asked questions |
| Troubleshooting | Common issues and solutions |
| Contributing | How to contribute |
- All messages, members, channels, and roles from servers the bot can access
- No data leaves your infrastructure — everything stays on your servers
- Store bot tokens in user secrets or secure vaults (never in code)
- Use HTTPS for dashboard access
- Restrict database access to trusted networks
- Enable PostgreSQL encryption at rest for sensitive data
- Regular backups to secure, separate storage
- Inform your community that messages are being archived
- Honor GDPR/CCPA data deletion requests
- Consider retention policies for sensitive data
We welcome contributions of all kinds!
- 🐛 Bug reports: Open an issue
- 💡 Feature ideas: Start a discussion
- 📝 Documentation: Fix typos, add examples, improve clarity
- 🔧 Code: See CONTRIBUTING.md
# Development workflow
git clone https://github.com/JerrettDavis/DiscordDataMirror.git
cd DiscordDataMirror
dotnet build
dotnet testThis project is licensed under the MIT License — see the LICENSE file for details.
- Discord.Net — Discord API wrapper
- MudBlazor — Blazor component library
- .NET Aspire — Cloud-native orchestration
Made with ❤️ by the community
⭐ Star this repo if you find it useful!

