Deployment
Upgrading BAP
Guide to upgrading Burning Ash Protocol to new versions with migration steps.
Upgrading BAP
This guide covers upgrading BAP to new versions.
Versioning
BAP uses Semantic Versioning:
- Major (x.0.0) — Breaking changes
- Minor (0.x.0) — New features
- Patch (0.0.x) — Bug fixes
Check Current Version
# API version
curl http://localhost:8080/api/health
# Or check Docker image
docker-compose imagesUpgrade Process
1. Backup
Before upgrading, always backup:
# Database backup
docker cp bap-api-1:/data/bap.db ./backup/bap-$(date +%Y%m%d).db
# Or PostgreSQL
docker exec bap-postgres-1 pg_dump -U bap bap > backup/bap-$(date +%Y%m%d).sql2. Pull Latest
# Get latest code
git pull origin main
# Or pull images
docker-compose pull3. Check Migration Notes
Review CHANGELOG.md or release notes for:
- Breaking changes
- Database migrations
- Configuration changes
4. Upgrade
# Rebuild and start
docker-compose build
docker-compose up -d5. Verify
# Check health
curl http://localhost:8080/api/health
# Check logs
docker-compose logs -fDatabase Migrations
Automatic Migrations
Migrations run automatically on startup:
API starting...
Running migrations...
Migration 001_create_hosts up
Migration 002_create_survivors up
...
Migrations completeManual Migrations
Migrations run automatically when the API starts. To force a restart:
docker-compose restart apiMigration Rollback
If issues occur:
# Restore database
docker-compose down
docker cp backup/bap-20240101.db bap-api-1:/data/bap.db
docker-compose up -dCommon Upgrade Scenarios
Minor Upgrades (0.x.0 → 0.x+1.0)
Usually simple:
git pull
docker-compose build
docker-compose up -dMajor Upgrades (0.x.0 → x.0.0)
May require extra steps:
- Read migration guide
- Backup thoroughly
- Test in staging first
- Follow upgrade script
Patch Upgrades (0.0.x → 0.0.x+1)
Quick:
docker-compose pull
docker-compose up -dConfiguration Changes
Env Variable Changes
Check release notes for new/removed variables.
Example migration:
# Old
API_PORT=8080
# New (if renamed)
BAP_PORT=8080Update .env and restart.
Troubleshooting
Migration Fails
# Check logs
docker-compose logs api | grep migration
# Common causes:
# - Missing backup
# - Permission issues
# - Schema conflictsService Won't Start
# Check logs
docker-compose logs api
# Common causes:
# - Missing env vars
# - Database locked
# - Port conflictDatabase Locked
# SQLite - check for lock file
ls -la data/*.db*
# Remove lock if safe
rm data/bap.db-journalUpgrading from Development
To Production
- Switch to PostgreSQL
- Configure reverse proxy with SSL
- Update environment variables
- Set secure JWT_SECRET and MASTER_KEY
Version-Specific Notes
v1.0.0
First stable release.
v0.x.x
Pre-1.0 releases may have:
- More frequent breaking changes
- Less migration documentation
Check release notes for details.
Next Steps
- Docker Compose — Initial setup
- Production Checklist — Security
- Reverse Proxy — Proxy setup