Update Overview
Bitwarden Server updates typically include:- Security patches and bug fixes
- New features and functionality
- Database schema changes (migrations)
- Performance improvements
- Dependency updates
Pre-Update Checklist
1
Review Release Notes
Check the Bitwarden release notes for:
- Breaking changes
- Migration requirements
- New configuration options
- Known issues
2
Create Backup
Perform a complete backup:Verify backup integrity before proceeding.
3
Check Disk Space
Ensure sufficient disk space:
4
Schedule Maintenance Window
Plan for downtime during:
- Off-peak hours
- With user notification
- Duration: 15-60 minutes depending on deployment size
5
Review Current Version
Document current version:
Update Procedures
Docker-Based Updates
Standard Update
1
Stop Services
Stop all Bitwarden services:
2
Update Script
Update the Bitwarden installation script:
3
Pull New Images
Download updated Docker images:
4
Run Database Migrations
Apply any database schema changes:The migration system will:
- Create the database if it doesn’t exist
- Apply new migration scripts
- Track applied migrations in the
Migrationtable
5
Start Services
Restart all services:
6
Verify Update
Test critical functionality:
- User login
- Vault access
- Organization operations
- Admin portal access
Update Specific Services
Update individual services:Manual Updates
For custom deployments:Database Migrations
Migration System
Bitwarden uses DbUp for database migrations with features:- Transaction-wrapped execution
- Automatic retry on “script upgrade mode” errors
- Script versioning and tracking
- Configurable timeouts (5 minutes default, 60 minutes for large migrations)
util/Migrator/DbMigrator.cs
Migration Process
Automatic Migration
- Connects to the database
- Creates database if it doesn’t exist
- Executes pending migration scripts
- Records applied migrations
Manual Migration
Run the migrator directly:Dry Run
Preview migrations without applying:Migration Retry Logic
The migrator includes automatic retry for transient failures:Migration History
View applied migrations:Migration Scripts
Migration scripts are located in:util/Migrator/DbScripts/- Main migrationsutil/MySqlMigrations/- MySQL-specificutil/PostgresMigrations/- PostgreSQL-specific
Rollback Procedures
Quick Rollback
If issues are detected immediately after update:1
Stop Services
2
Restore Previous Images
Revert to previous Docker images:
3
Restore Database
If database migrations were applied:
4
Restart Services
Database-Only Rollback
If only the database needs to be rolled back:Zero-Downtime Updates
For high-availability deployments:Blue-Green Deployment
1
Deploy Green Environment
Create a parallel environment with updated version:
2
Sync Database
Use database replication to sync data to green environment.
3
Test Green Environment
Verify all functionality in green environment.
4
Switch Traffic
Update load balancer to point to green environment:
5
Monitor and Validate
Watch for errors. If issues arise, switch back to blue.
Rolling Updates
For multi-instance deployments:Post-Update Verification
Functional Testing
1
Authentication
Test user login with various methods:
- Email/master password
- SSO (if configured)
- Two-factor authentication
2
Vault Operations
Verify core functionality:
- View items
- Add/edit items
- Delete items
- Share items
3
Organization Features
Test organization-specific features:
- User management
- Collection access
- Group permissions
- Event logs
4
Admin Functions
Verify admin portal:
- License status
- User overview
- System health
Health Checks
Log Review
Check logs for errors:Update Automation
Automated Update Script
Schedule with Cron
Best Practices
Regular Updates
Update at least monthly. Security updates should be applied within 1 week of release.
Test First
Test updates in a staging environment before applying to production.
Monitor Releases
Subscribe to Bitwarden release notifications to stay informed of updates.
Document Changes
Maintain a change log of all updates, including date, version, and any issues encountered.
Troubleshooting Updates
Update Fails to Download Images
Issue: Docker pull fails or times out Solutions:- Check internet connectivity
- Verify Docker Hub access
- Check disk space:
df -h - Clear Docker cache:
docker system prune -a
Migration Fails
Issue: Database migration errors Solutions:- Check migration logs:
docker logs bitwarden-migrator - Verify database connectivity
- Check SQL Server state: ensure not in “script upgrade mode”
- Review specific migration script for issues
Services Won’t Start After Update
Issue: Services fail to start post-update Solutions:- Check service logs:
docker logs <service> - Verify configuration files
- Check for port conflicts:
netstat -tulpn - Ensure all dependencies are running