Overview
Thebench update command performs a comprehensive update operation on your bench. By default, it backs up sites, pulls updates for all apps, updates requirements, builds assets, runs database migrations, and restarts services. You can use specific flags to perform only certain tasks.
Syntax
Options
Pull the latest updates from Git repositories for all apps in the bench.
Specify which apps to update. Provide a comma-separated list of app names.
Run database migrations for all sites in the bench.
Build JavaScript and CSS assets for the bench.
Update Python and Node.js dependencies. If run alone, equivalent to
bench setup requirements.Restart Supervisor processes after the update completes.
Restart systemd units after the update completes.
Skip backing up sites before performing updates.
Force major version upgrades. Use this when upgrading to a new major version of Frappe or ERPNext.
Hard reset Git branches to their remote states, overriding any local changes and conflicts. This is equivalent to
git reset --hard origin/branch.[DEPRECATED] This flag no longer has any effect and is kept for backward compatibility.
Usage Examples
Full Update (Default)
Perform a complete update with all operations:- Backup all sites
- Pull updates for all apps
- Update requirements
- Run database migrations
- Build assets
- Restart services
Update Specific Apps
Update only Frappe and ERPNext:Pull Updates Only
Just pull the latest code without building or migrating:Build Assets Only
Rebuild front-end assets without pulling code:Run Migrations Only
Execute database patches without other operations:Update Requirements Only
Install updated Python and Node.js dependencies:Quick Development Update
Update without backup (development only):Force Major Version Upgrade
Upgrade to a new major version:Reset to Remote State
Discard local changes and sync with remote:Production Update with Supervisor
Update and restart production services:What Happens During Update
1. Backup (unless —no-backup)
2. Pull Updates (unless specific flags)
3. Update Requirements
4. Migrate Sites
5. Build Assets
6. Restart Services
Common Patterns
Safe Production Update
Recommended approach for production environments:Development Quick Update
Fast update during development:Update After Code Changes
When you’ve made changes to app code:Fix Broken Update
If an update fails or causes issues:Version Control Behavior
Normal Update (git pull —rebase)
By default,bench update --pull attempts to rebase local commits:
Reset Mode (git reset —hard)
With--reset, local changes are discarded:
Updating to Specific Versions
To update to a specific Frappe or ERPNext version:Troubleshooting
Update Fails with Merge Conflicts
Reset to remote state:Migration Errors
If migrations fail:Asset Build Failures
Rebuild with verbose output:Requirements Installation Issues
Manually update requirements:Performance Considerations
Large Benches
For benches with many apps or sites:Reducing Downtime
Minimize production downtime:Automated Updates
Set up automatic updates (use with caution):Related Commands
bench switch-to-branch- Switch apps to a specific branchbench migrate- Run only database migrationsbench build- Build only assetsbench backup-all-sites- Backup all sitesbench retry-upgrade- Retry a failed upgrade