2.7 KiB
2.7 KiB
Migration Guide
This guide covers database migrations and version upgrades for ACC Server Manager.
Database Migrations
The application handles database migrations automatically on startup. No manual intervention is required for most upgrades.
Automatic Migrations
When you start the application:
- It checks the current database schema
- Applies any pending migrations
- Updates the schema version
Manual Migration (if needed)
If automatic migration fails:
# Backup your database first
copy acc.db acc_backup.db
# Delete the database and let it recreate
del acc.db
# Start the application - it will create a fresh database
./api.exe
Upgrading ACC Server Manager
From v1.x to v2.x
-
Backup your data
copy acc.db acc_backup.db copy .env .env.backup -
Stop the application
# If running as service nssm stop "ACC Server Manager" -
Update the code
git pull go build -o api.exe cmd/api/main.go -
Update configuration
- Check
.env.examplefor new required variables - Run
.\scripts\generate-secrets.ps1if needed
- Check
-
Start the application
./api.exe # Or restart service nssm start "ACC Server Manager"
Breaking Changes
v2.0
- Changed from system_configs table to environment variables
- Now use
STEAMCMD_PATHandNSSM_PATHenvironment variables - UUID fields added to all tables (automatic migration)
v1.5
- Authentication system overhaul
- New permission system
- Password requirements enforced
Data Backup
Regular Backups
Create a scheduled task to backup your database:
# PowerShell backup script
$date = Get-Date -Format "yyyy-MM-dd"
Copy-Item "acc.db" "backups\acc_$date.db"
What to Backup
acc.db- Main database.env- Configuration and secretslogs/- Application logs (optional)- Server configuration files in each server directory
Rollback Procedure
If an upgrade fails:
- Stop the application
- Restore the database:
copy acc_backup.db acc.db - Restore the configuration:
copy .env.backup .env - Use the previous binary version
- Start the application
Common Migration Issues
"Database locked"
- Stop all instances of the application
- Check for stuck processes
"Schema version mismatch"
- Let automatic migration complete
- Don't interrupt during migration
"Missing columns"
- Database migration was interrupted
- Restore from backup and retry
Best Practices
- Always backup before upgrading
- Test upgrades in a non-production environment first
- Read release notes for breaking changes
- Keep the last working version's binary
- Monitor logs during first startup after upgrade