Updating openLogForge - Docker Compose
This guide covers how to safely update an existing Docker Compose deployment of openLogForge to a new version.
Back up your data before updating
Always create a database backup before pulling a new version. See Step 1 below.
Step 1 - Back up the database
The database lives inside a Docker named volume (olf-data). Export a copy to the host before making any changes.
# Create a backup directory if it does not exist
mkdir -p ~/openlogforge-backups
# Copy the database out of the running container
docker compose exec app sh -c "cp /data/openlogforge.db /tmp/openlogforge-backup.db"
docker compose cp app:/tmp/openlogforge-backup.db \
~/openlogforge-backups/openlogforge-$(date +%Y%m%d-%H%M%S).db
echo "Backup saved to ~/openlogforge-backups/"
ls -lh ~/openlogforge-backups/
Step 2 - Check the current version
Note the current version tag so you can roll back to it if needed.
Step 3 - Pull the latest code
Navigate to the directory where you cloned the repository:
Review what changed before applying the update:
Check CHANGELOG.md for breaking changes or manual migration steps:
Step 4 - Rebuild and restart
Docker rebuilds both images, stops the old containers, and starts the new ones. Alembic database migrations run automatically during backend startup before the API becomes available.
Step 5 - Verify the update
Check both containers are running:
Expected output:
NAME IMAGE STATUS PORTS
openlogforge-app-1 openlogforge-app Up 8000/tcp
openlogforge-web-1 openlogforge-web Up 0.0.0.0:80->8080/tcp
Check the backend logs for migration output and a clean start:
Look for lines similar to:
Confirm the web interface loads correctly in your browser.
Rolling back
If the update causes problems, roll back to the previous version.
Step 1 - Stop the current containers:
Step 2 - Check out the previous version tag:
# List available tags
git tag --sort=-version:refname | head -10
# Check out the version you want to roll back to
git checkout v0.2.0 # replace with your previous version
Step 3 - Restore the database backup:
# Copy your backup into the volume via a temporary container
docker run --rm \
-v openlogforge_olf-data:/data \
-v ~/openlogforge-backups:/backup \
alpine sh -c "cp /backup/<your-backup-file>.db /data/openlogforge.db"
Replace <your-backup-file> with the filename you noted in Step 1.
Step 4 - Rebuild and start the old version:
Scheduled maintenance window
For production deployments, consider the following sequence to minimise downtime:
- Run the backup (Step 1) during business hours - it takes seconds
- Schedule the update (Steps 3-4) during a low-traffic window
- Keep the terminal open and tail the logs during restart:
- Verify the UI is responsive before closing the terminal