Operations guide
Bot host operations
This page summarizes deployment, migration, and operational checks for the VIRCON bot host.
Prerequisites
- Node.js v18+
- PM2 process manager
- Discord bot token
- VRChat account credentials
- Server with 1GB RAM recommended
Environment keys
Support ticket transcripts
Closing a ticket saves an HTML copy in the hub transcript channel and ticket post. The View transcript on website button opens the saved conversation in Support, with images, media and file attachments alongside their original messages. Requesters can see only their own tickets without internal notes; VIRCON hub staff and the bot owner can see the staff transcript. Discord sign-in returns viewers to the linked ticket. Larger saved attachments load in chunks to fit website response limits.
Keep the main bot database and data/tickets directory together when backing up or moving the bot. PUBLIC_SITE_URL controls the Discord buttons and defaults to https://www.virconlogger.com.
PM2 services
Migration steps
- Stop the bot and create a final database backup.
- Transfer source, .env, and data/backups to the server.
- Install dependencies and run database checks.
- Start services with PM2 and save the config.
- Verify registrations and command responses.
Verification checklist
- Bot shows online in Discord.
- pm2 list shows all services online.
- node check-db.js returns correct registration count.
- Error log channel receives alerts.
- Hourly backups appear in data/backups.
Stage lock controls
Stage 2-7 commands remain locked unless explicitly enabled.
- Stage 2-7 commands are locked by default.
- Use feature-lock-control.js unlock to enable later stages.
- Re-lock anytime with feature-lock-control.js lock.
Rollback plan
- Stop all bot services on the server.
- Restart the previous host or restore the last known good backup.
- Verify registrations and command responses.
- Notify staff that rollback is complete.
Security checklist
- Keep .env files out of git and restrict file permissions.
- Rotate VRChat credentials after migrations.
- Confirm the bot token has not been regenerated.
- Allow outbound Discord and VRChat traffic on the host.
- Validate backups before deleting older snapshots.
Monitoring commands
Use these during deploys and incident response.