Title: Streamlining Frappe App Upgrades – Avoiding Data Loss and Friction
Category: Frappe Framework
Tags: upgrade
migration
data-loss
suggestion
I’ve been self-hosting Frappe & Builder via the official easy-install Docker setup, and every time I pull a new “stable” image and run migrations, I’m terrified I’ll lose site data. Most recently I ran through the entire docker compose pull && bench --site all migrate && bench --site all build
flow, and ended up with missing assets, 502s, and ultimately had to restore from backup because some critical doctypes and customizations disappeared.
I know part of it may be me—my workflow for zero-downtime doesn’t follow the “ideal” pattern—but it feels like upgrading any of the frappeverse apps (framework, erpnext, builder, etc.) should be a one-click, safe operation rather than a multi-step CLI dance that can silently drop data.
My environment & steps:
- Easy-install Python script → generates
builder_prod_setup-compose.yml
+.env
docker compose pull && down && up -d --remove-orphans
docker compose exec backend bench --site all migrate build clear-cache
- Hard-refresh browser → 404s, missing doctypes, broken hooks
- Restore from backup & repeat
Pain points:
- No transactional “upgrade plan” – if one step fails, you’re left in a half-migrated state.
bench update
inside a Docker image can’t detect branches, so I skip it and lose patch releases.- Assets (CSS/JS) often don’t copy correctly into
sites/assets
without manualbench build/assets
. - No rollback mechanism beyond full database restore.
Questions & suggestions:
- Is there a recommended Docker-native upgrade workflow that ensures migrations run safely and atomically?
- Could Frappe provide a bench upgrade GUI (or API endpoint) inside Desk to automate pulls, migrations, build, and cache-clear?
- Are there plans to support an officially idempotent upgrade process (like Kubernetes operators or a Helm chart) that guards against partial failures?
I’d love to hear how others are handling seamless upgrades in production, and of course, if the core team is open to improving the user experience here, I’m happy to help test or contribute. Thanks!