Skip to content

Repository files navigation

Language / Nyelv: English | Magyar

MAC Migration Tool

CLI tool for conscious macOS machine migration (e.g. M1 → new M-series Mac). Use this when you do not want a 1:1 clone (Migration Assistant), but also do not want to lose custom data (sample libraries, exports, oddly named project folders).

Why not a fixed rules script?

A static script only catches patterns you thought of in advance (Ableton, Samples, etc.). Folders like final-export or samples-v2 need contextual interpretation — Phase B uses Google Enterprise Agent Platform (Gemini Flash Lite) for that, with a rule-based fallback if you skip the cloud API.

Architecture

PhaseScriptOutput
A — Collectcollector/* (11 steps)~/migration-inventory/ (Markdown + JSON)
B — Analyzeanalyzer/analyze.pyanalysis-report.md + analysis-report_HU.md (+ JSON)
C — Planplanner/generate-plan.pymigration-plan.md + migration-plan_HU.md (+ JSON)
D — Guideplanner/generate-reinstall-guide.pyreinstall-guide.md + reinstall-guide_HU.md
Restorerestorer/restore.pyOn new Mac: aliases, shell, Homebrew, VS Code, Quick Actions, audio
Viewviewer/generate_dashboard.pydashboard.html

All user data stays local under ~/migration-inventory/. Only folder metadata (path, size, extension stats — never file contents or credentials) is sent to Agent Platform.

Prerequisites

  • macOS (source machine)
  • Homebrew (recommended, not required for collector)
  • Python 3.11+
  • GCP project with billing enabled (for AI analyze; optional with --fallback)
  • Application Default Credentials (ADC) — no API keys, no JSON key files

Authentication (ADC only)

Not supported: API keys, service account JSON keys, GOOGLE_APPLICATION_CREDENTIALS.

One-time setup outside this tool (then every analyze run is automatic):

gcloud auth application-default login

On the first analyze run, mac-migration automatically in the background:

  1. Verifies ADC is available (via google.auth.default())
  2. Enables Vertex AI API (aiplatform.googleapis.com) on your --project

Use --skip-gcp-setup if the API is already enabled.

Quick start

git clone <repo-url> mac-migration
cd mac-migration
chmod +x mac-migration
pip install -r analyzer/requirements.txt
# Full pipeline (after ADC is configured)
./mac-migration all --project YOUR_PROJECT_ID -i
# Without Agent Platform (rule-based fallback)
./mac-migration all --fallback

Step by step

# Phase A — full inventory (11 steps, ~10–30 min on large homes)
./mac-migration collect
# Phase B — interactive AI review (recommended)
./mac-migration analyze --project YOUR_PROJECT_ID --interactive
# Phase C — checklist
./mac-migration plan
# Phase D — self-contained reinstall guide
./mac-migration guide
# HTML dashboard
./mac-migration view
# On new Mac — automatic restore
bash ~/migration-inventory/restore.sh
# or: ./mac-migration restore all

Phase A — what gets collected?

The collect runs 11 steps and inventories the whole machine:

#OutputCoverage
10108 *.mdApps, package managers, runtimes, dotfiles, auth, editors
209-shell-environment.mdShell, aliases, pyenv, nvm, PATH
312-homebrew-full.mdEvery Homebrew formula, cask, tap, service
411-vscode-extensions.mdVS Code, Cursor, Insiders, VSCodium extensions
514-quick-actions.mdQuick Actions (Automator) + Shortcuts.app
615-audio-devices.mdBlackHole, HAL plugins, DJ/audio devices
710-ai-dev-creative-tools.mdAI, dev, creative apps (Cursor, Terraform, Ableton, …)
8collector-output.json7000+ folder profiles (includes ~/.* dot dirs)
913-custom-paths.mdNon-stock macOS paths
1016-full-system-inventory.mdLogin items, browser extensions, LaunchAgents, VPN, cron, git, Docker, Alfred/Karabiner, iTerm, fonts, printers, Wi‑Fi, Bluetooth, App Store
11restore-manifest.json + restore.shDynamic restore plan for the new Mac

Key JSON files:system-inventory.json, environment-snapshot.json, homebrew-inventory.json, vscode-extensions.json, quick-actions-inventory.json, audio-devices-inventory.json, tools-inventory.json, custom-paths.json, restore-manifest.json

Automatic restore on new Mac:bash ~/migration-inventory/restore.sh applies aliases, shell init, Homebrew, VS Code extensions, Quick Actions, and audio drivers dynamically.

Restore components:./mac-migration restore [aliases|shell|homebrew|vscode|quick-actions|audio|all]

Configuration

FlagDefaultDescription
--project(required)GCP project ID
--modelgemini-3.5-flash-liteGemini 3.5 Flash Lite (global model ID)
--locationglobalAgent Platform location (global endpoint)
--batch-size30Folders per API call (batch mode)
--min-size-mb100Skip smaller folders (batch mode)
--fallbackoffRule-based analysis, no cloud
-i, --interactiveoffAI review per component (recommended)

Folder categories (Phase B)

  • user_custom — must copy (samples, exports, projects)
  • app_data — usually restored on reinstall
  • cache_or_temp — safe to skip
  • uncertain — manual review

Migration plan actions (Phase C)

  • Copy 1:1user_custom folders → external SSD
  • Reinstall — apps from inventory / Brewfile
  • Rebuild consciously — dotfiles, runtimes, Homebrew bundle
  • Skip — cache/temp
  • Re-authenticate — SSH, GPG, cloud CLIs on new Mac

Security

  • Sensitive directories (.ssh, .gnupg, .aws, .kube, .config/gcloud, etc.) are profiled with a sensitive flag — metadata only, never file contents.
  • Auth section: existence/count only — no secret contents exported.
  • Git config values are redacted in inventory output.
  • Passwords, SSH keys, and Keychain contents are never auto-copied.

FAQ

I don't have Agent Platform access

./mac-migration analyze --fallback --interactive
./mac-migration plan

How long does Phase A take?

Depends on home directory size. Large ~/Library trees can take 10–30 minutes. Progress is printed every 100 folders.

Where is output stored?

Everything under ~/migration-inventory/ — not committed to git.

Development

pytest collector/tests/ analyzer/tests/ planner/tests/ restorer/tests/ -q
shellcheck collector/*.sh mac-migration

License

CloudMentor Use License — free use (including commercial) and redistribution of unmodified copies. Modifications require written permission from CloudMentor (info@cloudmentor.hu). Hungarian summary: LICENSE_HU.md.

About

Migrate MAC to MAC

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages