Part IV — Expert Production Engineering · Chapter 24 · Lesson 5 of 7 · 2 min read
Lesson 5: Migration Planning, Smoke Testing, Backups, and Rollback
Lesson level: Expert
Purpose: A migration is complete only when forward behavior and recovery are demonstrated with actual state and fixtures.
Learning Objectives
- Separate reported compatibility from executed evidence.
- Build a controlled validation and recovery plan.
- Preserve unresolved release blockers explicitly.
5.1 Concepts
Migration changes executable artifacts, host contracts, stored state, and deployment policy. Preserve the last known-good wheel, pipeline, registry, monitoring data, and serving manifest before modifying an environment. The source migration_guide lists backups, artifact verification, isolated installation, compatibility checks, connector and serving smoke tests, and rollback validation. Apply those steps to your actual storage formats and operating constraints.
5.2 Annotated Example
pea migrate --from 0.62 --to 0.63 --check . reports source migration suggestions without writing. The source supply_chain.migration_check contains hard-coded compatibility booleans and path-existence checks; upgrade_compatibility returns supported entries without running application migrations. Annotation: neither report proves database schema compatibility or successful restoration. Execute fixture-based migration and restore tests separately.
5.3 Guided Practice
List which state a wheel downgrade cannot restore. Explain the order of backing up stores, verifying artifacts, warming a new runtime, changing routing, and testing the prior version.
5.4 Common Mistakes
Do not perform untested in-place upgrades, restore only code after mutating state, treat path existence as compatibility evidence, or remove backups before the rollback window closes.
5.5 Hands-On Lab
- Back up a disposable registry and monitoring store and verify restoration.
- Run non-mutating source checks and inspect the proposed changes.
- Exercise serving, connector, and host-value fixtures against old and candidate versions.
- Rollback both code and changed state, then repeat fixtures to prove recovery.
Deliverable: Executed fixture evidence, recovery or threat matrix, and an honest gate decision.
5.6 Review Questions
What does migrate --check avoid changing? What does migration_check actually validate? Which backup and restore evidence is required before promotion?
5.7 Applied Challenge
Write a versioned migration runbook with stop conditions, approved backups, schema probes, smoke tests, rollback order, and measurable recovery acceptance.
Lesson Summary
A migration is complete only when forward behavior and recovery are demonstrated with actual state and fixtures.
Lesson status: Draft complete; ready for review. Source-checked, not a release approval.