Files
portfolio/migration-validation-framework/README.md
T

57 lines
2.2 KiB
Markdown
Raw Normal View History

# Migration Validation Framework
2026-04-29 23:30:30 +00:00
## Problem Statement
2026-04-29 23:30:30 +00:00
Infrastructure migrations often fail in small, expensive ways: a mount option changes, a service is disabled, or disk usage moves past an operational threshold. Teams need structured evidence that the migrated host still matches the expected operating profile.
2026-04-29 23:30:30 +00:00
## Solution Overview
2026-04-29 23:30:30 +00:00
This project provides a Python CLI that collects system state into JSON snapshots and compares before/after files. The output is designed for change records, migration gates, and post-cutover validation.
2026-04-29 23:30:30 +00:00
## Architecture Overview
```
2026-04-29 23:30:30 +00:00
Operator -> CLI -> Collectors -> JSON Snapshot -> Comparator -> Diff/Report
```
2026-04-29 23:30:30 +00:00
Core components:
2026-04-29 23:30:30 +00:00
- `cli.py` provides collect, compare, snapshot, list, and report commands.
- `collectors/` gathers mounts, services, and disk usage.
- `validators/compare.py` identifies drift and validation failures.
- `reports/` contains report generation helpers.
- `examples/` contains realistic before/after evidence.
2026-04-29 23:30:30 +00:00
## How to Run
```bash
cd migration-validation-framework
2026-04-29 23:30:30 +00:00
python3 cli.py collect --output before.json --systems web01,db01
python3 cli.py collect --output after.json --systems web01,db01
python3 cli.py compare before.json after.json --output diff.json
python3 cli.py compare examples/before.json examples/after.json --output /tmp/migration-diff.json
```
2026-04-29 23:30:30 +00:00
Legacy snapshot IDs are still supported:
```bash
2026-04-29 23:30:30 +00:00
python3 cli.py snapshot --env prod --label pre --systems web01,db01
python3 cli.py compare prod-pre-20260429_020000 prod-post-20260429_030000 --output change-0429
```
2026-04-29 23:30:30 +00:00
## Example Output
2026-04-29 23:30:30 +00:00
```text
Comparison completed: diff.json (FAIL)
Overall risk: high
Total changes: 4
Failed checks: critical_services_running
Recommendation: restore sshd before production cutover
```
2026-04-29 23:30:30 +00:00
Sample inputs and output are available in [examples/before.json](examples/before.json), [examples/after.json](examples/after.json), and [examples/diff.json](examples/diff.json).
2026-04-29 23:30:30 +00:00
## Real-World Use Case
2026-04-29 23:30:30 +00:00
During a data center migration, a platform team can collect baseline state before cutover, collect the same evidence after DNS or workload migration, and attach the diff to the change ticket. The framework gives reviewers a compact signal on whether the host is ready for production traffic.