Getting Started
This guide will walk you through setting up DiscordDataMirror from scratch. By the end, you'll have a fully functional Discord archiving system running on your machine.
Prerequisites
Before you begin, ensure you have the following installed:
| Requirement | Minimum Version | Download |
|---|---|---|
| .NET SDK | 10.0 | Download |
| Docker Desktop | 4.0+ | Download |
| Git | 2.0+ | Download |
Verify Installation
# Check .NET version
dotnet --version
# Should output: 10.0.x
# Check Docker is running
docker --version
# Should output: Docker version 24.x or higher
Step 1: Clone the Repository
git clone https://github.com/JerrettDavis/DiscordDataMirror.git
cd DiscordDataMirror
Step 2: Create a Discord Bot
You'll need a Discord bot to monitor your servers. Follow the complete bot setup guide or use the quick steps below:
- Go to Discord Developer Portal
- Click "New Application" and name it (e.g., "Server Backup Bot")
- Navigate to Bot → Add Bot
- Enable Privileged Gateway Intents:
- ✅ SERVER MEMBERS INTENT
- ✅ MESSAGE CONTENT INTENT
- Click Reset Token and copy your bot token
⚠️ Keep your token secret! Never commit it to git or share it publicly.
Step 3: Configure the Bot Token
Option A: Interactive Setup Script (Recommended)
# Windows PowerShell
.\scripts\setup-bot.ps1
# Linux/Mac
./scripts/setup-bot.sh
The script will:
- Prompt for your bot token
- Store it securely in .NET User Secrets
- Validate the token works
- Generate your bot invite URL
Option B: Manual Configuration
cd src/DiscordDataMirror.Bot
dotnet user-secrets set "Discord:Token" "YOUR_BOT_TOKEN_HERE"
Step 4: Invite the Bot to Your Server
The setup script provides an invite URL, or construct one manually:
https://discord.com/oauth2/authorize?client_id=YOUR_CLIENT_ID&permissions=66560&scope=botOpen the URL in your browser
Select the server you want to monitor
Click Authorize
📝 Note: You need "Manage Server" permission to add bots.
Step 5: Run the Application
cd src/DiscordDataMirror.AppHost
dotnet run
On first run, .NET Aspire will:
- Start a PostgreSQL container
- Apply database migrations
- Start the Discord bot service
- Launch the Blazor dashboard
Step 6: Verify Everything Works
Aspire Dashboard
Open https://localhost:17113 to see:
- All running services (green = healthy)
- Real-time logs from each service
- Distributed traces for debugging
Data Dashboard
Open https://localhost:5001 to:
- Browse your Discord servers
- View channels and messages
- Search across all data
Discord Server
Check your Discord server — the bot should appear online!
What Happens Next?
Once running, DiscordDataMirror will:
- Initial Sync — Fetch all accessible message history (may take time for large servers)
- Real-time Capture — Record all new messages, edits, and deletions
- Background Tasks — Periodically sync user profiles and server structure
Common Issues
"Discord token not configured"
- Ensure you ran the setup script or set the user secret correctly
- Check there are no extra spaces in your token
"Missing Access" errors in logs
- Ensure the bot has the required permissions (66560)
- Verify privileged intents are enabled in Developer Portal
Bot shows offline
- Check Docker Desktop is running
- Look for errors in the Aspire dashboard logs
- Verify your network allows Discord API access
Database connection errors
- Ensure Docker Desktop is running
- Try restarting the application
- Check no other service is using port 5432
Next Steps
Video Walkthrough
Coming soon: A step-by-step video guide for setting up DiscordDataMirror.