-
-
Notifications
You must be signed in to change notification settings - Fork 24
Updating BBS
BBS provides automated update mechanisms for the server software, agents, and Borg binaries. Updates can be performed via the web interface or command line.
BBS manages three types of updates:
- Server Updates: BBS web application and backend code
- Agent Updates: bbs-agent.py script on client machines
- Borg Updates: Borg binary versions on client machines
BBS automatically checks for updates daily, or you can manually check:
- Navigate to Settings → Updates tab
- Click Check for Updates button
- BBS queries the GitHub Releases API for the latest version
- Comparison shows:
-
Current Version: Installed version (from
VERSIONfile) - Available Version: Latest release on GitHub
- Status: Up to date or Update Available
-
Current Version: Installed version (from

Update Check Details:
- Queries:
https://api.github.com/repos/marcpope/borgbackupserver/releases/latest - Compares semantic versions (e.g., 0.9.3-beta vs. 0.9.4-beta)
- Shows release notes link for available update
If an update is available:
- Click Upgrade to vX.Y.Z button
- Confirm the upgrade
- BBS executes
/var/www/bbs/bin/bbs-updatein the background - Update progress is shown
- Page automatically refreshes when complete
What Happens During Update:
- Git fetch from remote repository
- Checkout latest release tag
- Run
composer install(update PHP dependencies) - Execute database migrations from
migrations/directory - Fix file permissions and ownership
- Restart PHP-FPM service
- Clear caches
Downtime:
- Typically 10-30 seconds
- Agents continue polling (jobs in progress continue)
- Users may see brief connection interruption
SSH to the BBS server and run:
sudo /var/www/bbs/bin/bbs-updateWhat It Does:
- Fetches latest code from GitHub
- Checks out the latest release tag (e.g.,
v0.9.4-beta) - Runs migrations
- Updates dependencies
- Restarts services
Output:
BBS Update Script
=================
Checking for updates...
Current version: 0.9.3-beta
Latest version: 0.9.4-beta
Update available!
Fetching updates from GitHub...
Checking out v0.9.4-beta...
Installing dependencies...
Running migrations...
Migration 2024-01-15_add_2fa.sql applied.
Fixing permissions...
Restarting PHP-FPM...
Update complete!
Current version: 0.9.4-beta
To update to a specific release tag:
sudo /var/www/bbs/bin/bbs-update /var/www/bbs v0.9.3-betaUsage: bbs-update [path] [tag]
Parameters:
-
path: BBS installation directory (default:/var/www/bbs/) -
tag: Git tag to checkout (omit for latest release)
To pull the latest code from the main branch (for testing):
sudo /var/www/bbs/bin/bbs-update /var/www/bbs mainUse Case: Beta/staging server running latest development code
Warning: Only use main branch on test servers, not production
BBS tracks agent versions to ensure compatibility:
-
Server Agent Version: Defined in
agent/bbs-agent.py(AGENT_VERSIONconstant) - Client Agent Versions: Reported by each agent on heartbeat
- Version mismatch warnings appear if agents are outdated
Navigate to Settings → Updates tab:
Agent Version Distribution Table:
| Version | Count | Status |
|---|---|---|
| 1.7.3 | 45 | Current |
| 1.7.2 | 5 | Outdated |
| 1.7.1 | 2 | Outdated |
Out of Date Counter: Shows number of agents not running current version
- Navigate to client detail page
- Click Update Agent button (top-right)
- Confirm the update
- BBS queues an
update_agentjob - Monitor progress in Queue → Job detail
Update Process:
- Agent receives
update_agentjob - Agent downloads latest
bbs-agent.pyfrom server:GET /api/agent/download - Validates downloaded script (checksum, syntax check)
- Backs up current script:
bbs-agent.py.bak - Replaces script with new version
- Restarts agent service:
systemctl restart bbs-agent - Reports success to server
Job Duration: 1-2 minutes
To update all agents at once:
- Navigate to Settings → Updates tab
- Click Update All Agents button
- Confirm bulk update
- BBS queues
update_agentjobs for all online agents - Monitor progress in Queue
Considerations:
- Only online agents are updated (offline agents update on next connection)
- Updates run in parallel (up to max concurrent jobs limit)
- Failed updates can be retried individually
Best Practice: Test agent update on 1-2 non-critical clients before bulk updating
BBS manages Borg binary versions across all agents:
- Available Versions: List of Borg releases synced from GitHub
- Target Version: The version BBS will install on new agents
- Client Versions: Current Borg version on each agent
BBS can fetch the latest Borg releases from GitHub:
- Navigate to Settings → Borg Versions tab
- Click Sync Borg Versions button
- BBS queries
borgbackup/borgGitHub Releases API - New versions are added to the available versions list
Frequency: Manual (run when you want to make a new Borg version available)
Available Versions Table:
| Version | Release Date | Agents Using | Actions |
|---|---|---|---|
| 1.4.0 | 2024-01-10 | 0 | Set as Target |
| 1.2.7 | 2023-12-05 | 30 | Set as Target |
| 1.2.6 | 2023-11-15 | 20 | Set as Target |
Choose which Borg version agents should use:
- Find desired version in the table
- Click Set as Target
- Target version is highlighted (green badge)
- New agents will install this version automatically
- Existing agents can be updated to this version
Recommendation: Use the latest stable Borg version unless there's a compatibility issue
- Navigate to client detail page
- Click Update Borg button
- Confirm update
- BBS queues an
update_borgjob - Monitor progress in Queue
Update Process:
- Agent receives
update_borgjob with target version - Agent attempts Method 1: Binary Download
- Downloads pre-compiled Borg binary from GitHub releases
- Validates checksum
- Installs to
/usr/local/bin/borg - Verifies:
borg --version
- If binary download fails, Method 2: Pip Install
- Runs:
pip3 install borgbackup=={target_version} - Verifies installation
- Runs:
- Reports success to server
Job Duration: 2-5 minutes (binary download is faster than pip)
- Navigate to Settings → Borg Versions tab
- Set target version (if not already set)
- Click Update Borg on All Agents
- Confirm bulk update
- BBS queues
update_borgjobs for all agents - Monitor progress in Queue
Important:
- All agents will be updated to the target version
- Backup jobs will pause during Borg update
- Failed updates can be retried
How It Works:
- Downloads pre-compiled Borg binary from GitHub releases
- URL:
https://github.com/borgbackup/borg/releases/download/{version}/borg-linux64 - Fast, no compilation required
- Works on most Linux distributions (glibc-based)
Advantages:
- Fast installation (download only)
- No dependencies required (Python, pip, compilers)
- Consistent across distributions
Limitations:
- Linux x64 only (no ARM, 32-bit)
- Requires glibc (doesn't work on musl-based systems like Alpine)
How It Works:
- Installs via Python pip:
pip3 install borgbackup=={version} - Compiles Borg from source if no wheel available
- Requires Python 3.6+ and pip
Advantages:
- Works on any architecture (ARM, x64, x86)
- Works on any Python-compatible OS
Limitations:
- Slower (may compile from source)
- Requires pip and development tools
- May fail if Python/pip not installed
Agent Fallback Logic:
- Try binary download
- If fails (checksum mismatch, architecture incompatible), fall back to pip
- If pip fails, report error
Migrations are SQL scripts that update the database schema when BBS is updated.
Location: /var/www/bbs/migrations/
Format: YYYY-MM-DD_description.sql
Example:
migrations/
├── 2024-01-10_add_plugins_table.sql
├── 2024-01-15_add_2fa_columns.sql
└── 2024-01-20_add_s3_sync_config.sql
When bbs-update runs:
- Checks
migrations_appliedtable for already-applied migrations - Scans
migrations/directory for new .sql files - Applies new migrations in alphabetical order
- Records each migration in
migrations_appliedtable - Reports success or failure
Migration Table:
CREATE TABLE migrations_applied (
id INT AUTO_INCREMENT PRIMARY KEY,
migration_name VARCHAR(255) NOT NULL,
applied_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);If migrations fail during update:
sudo /var/www/bbs/bin/bbs-update /var/www/bbs mainThis re-runs the update process, including migrations.
Checking Migration Status:
sudo mysql -e "SELECT * FROM bbs.migrations_applied ORDER BY applied_at DESC LIMIT 10;"Manually Applying a Migration:
sudo mysql bbs < /var/www/bbs/migrations/2024-01-15_add_2fa_columns.sql
sudo mysql -e "INSERT INTO bbs.migrations_applied (migration_name) VALUES ('2024-01-15_add_2fa_columns.sql');"If an update causes issues, roll back to a previous version:
-
Find Previous Version Tag:
cd /var/www/bbs git tag | tail -10
-
Checkout Previous Version:
sudo /var/www/bbs/bin/bbs-update /var/www/bbs v0.9.3-beta
-
Restore Database (if migrations were applied):
sudo /var/www/bbs/bin/bbs-restore /var/bbs/backups/bbs-backup-YYYY-MM-DD_HHMMSS.tar.gz
Important:
- Only roll back if absolutely necessary (data loss risk)
- Restore from backup created before the update
- Database migrations are NOT automatically reversed
To downgrade an agent to a previous version:
- Edit
agent/bbs-agent.pyon the server (changeAGENT_VERSIONto older version) - Copy an older version of the agent script to
/var/www/bbs/agent/bbs-agent.py - Run Update Agent on affected clients
Note: Downgrades are rarely needed and may cause compatibility issues.
To install an older Borg version:
- Navigate to Settings → Borg Versions
- Set an older version as target
- Click Update Borg on affected clients
Warning: Borg repositories may not be backward-compatible (newer Borg versions may create features that older versions cannot read).
-
Backup First: Ensure daily
bbs-backuphas run recently - Check Release Notes: Review GitHub release notes for breaking changes
- Test in Staging: Update beta server first, verify functionality
- Schedule Maintenance Window: Update during low-traffic periods
- Notify Users: Inform users of brief downtime
-
Monitor Logs: Watch
/var/log/apache2/error.logfor errors - Verify Migrations: Ensure all migrations apply successfully
- Test Functionality: After update, create a test backup job
- Check Agent Connectivity: Verify agents still connect after update
- Verify Version: Confirm current version matches expected version
- Test Key Features: Create backup, restore, check queue
- Monitor Notifications: Watch for error notifications
- Review Logs: Check for unexpected warnings or errors
- Stagger Updates: Don't update all agents at once
- Test First: Update 1-2 non-critical agents, verify success
- Bulk Update: Once tested, bulk update remaining agents
- Monitor Queue: Watch for failed update_agent jobs
- Read Borg Changelog: Check Borg release notes for compatibility issues
- Test Backup: After updating Borg, run a test backup on an agent
- Verify Restore: Test restore functionality with new Borg version
- Avoid Major Version Jumps: Update incrementally (1.2.x → 1.3.x → 1.4.x)
Error: "Unable to check for updates"
Possible Causes:
- No internet connection from BBS server
- GitHub API rate limit exceeded
- Firewall blocking outbound HTTPS
Solutions:
- Verify internet connectivity:
curl https://api.github.com - Check firewall rules (allow outbound port 443)
- Wait 1 hour if rate limited (GitHub allows 60 requests/hour for unauthenticated)
Error: "Migration failed: Table already exists"
Cause: Migration already partially applied
Solution:
- Manually mark migration as applied:
sudo mysql -e "INSERT INTO bbs.migrations_applied (migration_name) VALUES ('2024-01-15_add_2fa_columns.sql');" - Re-run update:
sudo /var/www/bbs/bin/bbs-update
Error: "Composer install failed"
Cause: Missing PHP extensions or composer not installed
Solution:
- Reinstall composer:
sudo apt install composer - Verify PHP extensions:
php -m | grep -E 'pdo|mysql|mbstring|curl' - Manually run:
cd /var/www/bbs && sudo composer install
Error: "Download failed: Connection timeout"
Cause: Agent cannot reach BBS server
Solution:
- Verify agent can reach server:
curl https://bbs.example.com/api/agent/download - Check firewall on agent and server
- Retry update job
Error: "Service restart failed"
Cause: Agent service not configured or systemd issue
Solution:
- SSH to client
- Check service status:
systemctl status bbs-agent - Manually restart:
sudo systemctl restart bbs-agent - Verify service is enabled:
sudo systemctl enable bbs-agent
Error: "Binary download failed: Checksum mismatch"
Cause: Corrupted download or MITM attack
Solution:
- Retry update (may be transient network issue)
- Agent will automatically fall back to pip install
- Verify network is secure (not intercepting HTTPS)
Error: "Pip install failed: No module named pip"
Cause: pip not installed on client
Solution:
- SSH to client
- Install pip:
sudo apt install python3-pip - Retry Borg update job
Issue: Settings → Updates shows old version after update
Cause: Browser cache showing old data
Solution:
- Hard refresh:
Ctrl+Shift+R(Windows/Linux) orCmd+Shift+R(Mac) - Check
VERSIONfile directly:cat /var/www/bbs/VERSION
- Server-Backup-and-Restore — Backing up before updates, disaster recovery
- Queue-and-Jobs — Monitoring update jobs
- Settings — Update settings configuration
-
CLI-Reference —
bbs-updatecommand reference - Troubleshooting — General troubleshooting guide
📖 User Manual
Getting Started
Using BBS
- Dashboard
- Managing Clients
- Client Profiles
- Linux Agent Setup
- macOS Agent Setup
- Windows Agent Setup
- Docker Agent Setup
- Repositories
- Storage Setup
- Backup Plans
- Restoring Files
- Database Backups
- Plugins
- Remote Storage
- S3 Offsite Sync
Monitoring
Administration
- Settings
- User Management
- Single Sign-On
- Two-Factor Authentication
- Updating BBS
- Server Backup and Restore
Reference