Load previous migration state if exists.
(self)
| 374 | return False |
| 375 | |
| 376 | def _load_migration_state(self): |
| 377 | """Load previous migration state if exists.""" |
| 378 | if self.migration_log.exists(): |
| 379 | try: |
| 380 | with open(self.migration_log, "r") as f: |
| 381 | state_data = json.load(f) |
| 382 | |
| 383 | # Update step completion status |
| 384 | completed_steps = state_data.get("completed_steps", []) |
| 385 | for step in self.steps: |
| 386 | if step.name in completed_steps: |
| 387 | step.completed = True |
| 388 | |
| 389 | print(f"[INFO] Loaded previous migration state: {len(completed_steps)} steps completed") |
| 390 | |
| 391 | except Exception as e: |
| 392 | print(f"[WARN] Could not load migration state: {e}") |
| 393 | |
| 394 | def _save_migration_state(self): |
| 395 | """Save current migration state.""" |