Save current migration state.
(self)
| 392 | print(f"[WARN] Could not load migration state: {e}") |
| 393 | |
| 394 | def _save_migration_state(self): |
| 395 | """Save current migration state.""" |
| 396 | if not self.dry_run: |
| 397 | try: |
| 398 | state_data = { |
| 399 | "timestamp": datetime.now().isoformat(), |
| 400 | "completed_steps": [step.name for step in self.steps if step.completed], |
| 401 | "failed_steps": [step.name for step in self.steps if step.error], |
| 402 | "steps": [{"name": step.name, "description": step.description, "required": step.required, "completed": step.completed, "error": step.error} for step in self.steps], |
| 403 | } |
| 404 | |
| 405 | with open(self.migration_log, "w") as f: |
| 406 | json.dump(state_data, f, indent=2) |
| 407 | |
| 408 | except Exception as e: |
| 409 | print(f"[WARN] Could not save migration state: {e}") |
| 410 | |
| 411 | def _generate_migration_report(self, success: bool): |
| 412 | """Generate migration report.""" |