Overview
Upgrading Chatwoot involves updating the application code, running database migrations, and restarting services. This guide covers various upgrade scenarios and best practices.Before You Upgrade
Pre-Upgrade Checklist
- Backup your data - See Backup and Restore
- Review release notes - Check GitHub releases for breaking changes
- Check system requirements - Verify compatibility with your environment
- Schedule downtime - Plan for maintenance window if needed
- Test in staging - Upgrade staging environment first if available
Check Current Version
Docker Compose Upgrade
For installations using Docker Compose:Step-by-Step Upgrade
Upgrade to Specific Version
Monitor Upgrade Progress
Source Installation Upgrade
For installations from source code:Standard Upgrade Process
Upgrade to Specific Version
Database Migrations
Chatwoot uses Rails migrations to update the database schema.Migration Tools
Chatwoot provides a custom database preparation task:- Creates database if it doesn’t exist
- Loads schema for fresh installations
- Runs migrations for existing installations
- Loads installation config after migrations
Manual Migration Steps
Migration Verification
Rollback Procedures
Docker Rollback
Source Installation Rollback
Zero-Downtime Upgrades
For production systems requiring high availability:Blue-Green Deployment
-
Set up parallel environment (Blue)
- Deploy new version on separate servers
- Use same database (read-only mode during migration)
-
Run migrations on separate database replica
- Test migrations don’t break old version
- Switch database to read-only briefly
- Run migrations
- Switch back to read-write
-
Switch traffic to new environment
- Update load balancer to route to new servers
- Monitor for issues
- Rollback if needed by switching load balancer back
Rolling Upgrade (Multiple Instances)
Version-Specific Upgrade Notes
Major Version Upgrades
When upgrading across major versions (e.g., 2.x to 3.x):- Review breaking changes in release notes
- Update environment variables if config changed
- Test integrations thoroughly
- Allow extra time for migrations
Ruby Version Updates
If upgrade requires new Ruby version:PostgreSQL Extensions
Chatwoot requires specific PostgreSQL extensions:Post-Upgrade Tasks
Verification Steps
Clear Caches
Reindex Search (if applicable)
Automated Upgrade Script
Troubleshooting Upgrades
Migration Fails
Asset Compilation Fails
Service Won’t Start
Best Practices
- Always backup before upgrading
- Test in staging environment first
- Read release notes for breaking changes
- Schedule upgrades during low-traffic periods
- Monitor closely after upgrade
- Keep upgrade window reasonable (inform users)
- Document your upgrade process and any issues
- Stay current - don’t skip too many versions
- Automate where possible but verify results
- Have rollback plan ready

