BAPBA Protocol
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 images

Upgrade 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).sql

2. Pull Latest

# Get latest code
git pull origin main

# Or pull images
docker-compose pull

3. 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 -d

5. Verify

# Check health
curl http://localhost:8080/api/health

# Check logs
docker-compose logs -f

Database Migrations

Automatic Migrations

Migrations run automatically on startup:

API starting...
Running migrations...
Migration 001_create_hosts up
Migration 002_create_survivors up
...
Migrations complete

Manual Migrations

Migrations run automatically when the API starts. To force a restart:

docker-compose restart api

Migration Rollback

If issues occur:

# Restore database
docker-compose down
docker cp backup/bap-20240101.db bap-api-1:/data/bap.db
docker-compose up -d

Common Upgrade Scenarios

Minor Upgrades (0.x.0 → 0.x+1.0)

Usually simple:

git pull
docker-compose build
docker-compose up -d

Major Upgrades (0.x.0 → x.0.0)

May require extra steps:

  1. Read migration guide
  2. Backup thoroughly
  3. Test in staging first
  4. Follow upgrade script

Patch Upgrades (0.0.x → 0.0.x+1)

Quick:

docker-compose pull
docker-compose up -d

Configuration Changes

Env Variable Changes

Check release notes for new/removed variables.

Example migration:

# Old
API_PORT=8080

# New (if renamed)
BAP_PORT=8080

Update .env and restart.

Troubleshooting

Migration Fails

# Check logs
docker-compose logs api | grep migration

# Common causes:
# - Missing backup
# - Permission issues
# - Schema conflicts

Service Won't Start

# Check logs
docker-compose logs api

# Common causes:
# - Missing env vars
# - Database locked
# - Port conflict

Database Locked

# SQLite - check for lock file
ls -la data/*.db*

# Remove lock if safe
rm data/bap.db-journal

Upgrading from Development

To Production

  1. Switch to PostgreSQL
  2. Configure reverse proxy with SSL
  3. Update environment variables
  4. 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

On this page