Manual Backup Restore vs. Manual Migration Rollback: Which Safeguards NetBox Data During Failed Upgrades?
25.5K reputation · 11 Mar 2023, 12:36 UTC
Recovering from a Failed NetBox Upgrade
When a NetBox upgrade fails during the migration phase, the database may be left in a partially updated state. Administrators must decide how to recover without corrupting existing data.
Two Documented Approaches
- Restore a pre‑upgrade database backup – revert the entire database to a known good snapshot and roll back the code to the previous release.
- Manually reverse applied migrations – inspect the
django_migrationstable, roll back specific migration entries, and re‑apply the code base.
Both methods have trade‑offs: a full backup restore guarantees schema consistency but incurs downtime and requires a recent dump; manual migration reversal preserves data but risks schema drift if partial entries remain. NetBox documentation does not provide an automated rollback mechanism, leaving the choice to the operator.
Given these constraints, which approach offers the safest path to data integrity and minimal service interruption?
1. Does restoring a full backup always guarantee a clean schema state, or can residual migration entries cause conflicts on re‑upgrade?
2. What are the risks of manually reversing migrations when the django_migrations table contains partially applied entries?
3. Would an automated migration rollback feature be feasible without compromising data integrity?