Skip to main content

Upgrade Guide

Server upgrade

Rolling update procedure

  1. Pull the latest code:

    git pull origin main
  2. Check for database migrations in server/db/migrations/ — new SQL files will be applied automatically on backend startup via the embedded migration runner.

  3. Rebuild and restart the backend:

    cd deploy
    docker compose -f docker-compose.community.yml build edr-backend
    docker compose -f docker-compose.community.yml up -d edr-backend

    nginx continues serving requests during the restart. The downtime window is the backend's startup time (~2 seconds).

  4. Rebuild and restart the dashboard:

    docker compose -f docker-compose.community.yml build edr-dashboard
    docker compose -f docker-compose.community.yml up -d edr-dashboard
  5. Full stack rebuild (when in doubt):

    docker compose -f docker-compose.community.yml down
    docker compose -f docker-compose.community.yml build
    docker compose -f docker-compose.community.yml up -d

Verifying the upgrade

# Check all services are healthy
docker compose -f docker-compose.community.yml ps

# Check backend version in logs
docker compose -f docker-compose.community.yml logs edr-backend | grep "server listening"

# Test health endpoint
curl http://localhost/health

Agent upgrade

Manual upgrade (single machine)

# Build new binary
go build -o sielum-agent ./agent/...

# Copy to system path
sudo cp sielum-agent /usr/local/bin/sielum-agent

# Restart service
sudo systemctl restart sielum-agent

# Verify
sielum-agent version
systemctl status sielum-agent

Database migrations

Migrations are run automatically on backend startup using embedded SQL files. The migration runner is idempotent — running it again on an already-migrated database is safe.

If you need to inspect the migration state:

docker compose -f docker-compose.community.yml exec edr-postgres psql -U sielum_app sielum \
-c "SELECT * FROM schema_migrations ORDER BY version;"

Rollback

If a new version causes issues:

  1. Backend rollback: Rebuild the previous version's image and restart
  2. Database rollback: If the new version added migrations, restore from backup before rolling back the binary
  3. Agent rollback: Replace binary with previous version and restart systemd service
warning

Database migrations are forward-only. Always back up before upgrading to a version with new migrations.