How to Move OpenAI Codex to a New Mac Without Cloning Its Identity
DEV Community

How to Move OpenAI Codex to a New Mac Without Cloning Its Identity

Changing Macs is Normally Straightforward

Changing Macs is normally straightforward. The surprising part is that signing into the same ChatGPT account does not necessarily recreate the local Codex working environment you had on the old machine.

The Problem with Blindly Syncing Codex Databases

Your repositories are only part of that environment. Local Codex conversations and state, project organization, custom skills, settings, Git worktrees, stashes, branches, and unfinished files can still live on the old Mac.

Deciding Whether to Migrate or Sync

First: decide whether you need migration or sync. A migration is a one-time move from an old Mac to a new Mac. The old environment is the source; the new installation is the destination. Sync means two Macs keep changing and must reconcile those changes repeatedly. That is a different and much harder problem.

What Usually Needs to Move

For a complete developer-workspace move, inspect these categories separately:

  • Portable local Codex conversations and working state
  • User configuration, rules, memories, automations, and custom skills
  • Selected project folders
  • Complete Git metadata: .git, local branches, worktrees, stashes, uncommitted files, and untracked files
  • Any workspace paths referenced by local Codex state

What You Should Not Clone Blindly

Do not treat the entire ~/.codex directory as one portable blob. The destination Mac should keep its own:

  • Codex/ChatGPT authentication
  • Installation or device identity
  • SSH private keys
  • Runtime sockets and locks
  • Logs and disposable caches

A Safer Transfer Sequence

  1. Keep the old Mac intact. Do not erase, trade in, or repurpose it yet.
  2. Make an independent backup. A rollback copy on the destination disk does not protect against disk failure.
  3. Inventory before copying. Find external Git directories, linked worktrees, cloud-only placeholders, symbolic links, permissions issues, and required disk space.
  4. Connect the Macs securely. SSH works over ordinary Wi-Fi, a USB-C network connection, or Thunderbolt. Verify the destination host fingerprint; do not disable host-key checking.
  5. Stage first. Copy into a separate staging area rather than directly over the live destination.
  6. Back up the destination. Verify that backup before replacing selected data.
  7. Close Codex writers on both migration accounts. Databases and state files should not be changing during finalization.
  8. Install, then verify. Check restored conversations, Codex identity, Git status, worktrees, branches, stashes, and representative projects.
  9. Plan for interruption. A cable disconnect, Wi-Fi loss, sleep, crash, or full disk should leave a resumable staged copy-not a half-replaced live workspace.

Verification Matters More Than "Copy Completed"

After the move, check at least:

  • The new Mac is still signed into the intended ChatGPT account
  • Its Codex installation identity is distinct from the old Mac
  • Expected active and archived conversations appear
  • Selected projects open at the intended paths
  • git status matches the source for representative repositories
  • Local branches, stashes, and linked worktrees are present
  • Uncommitted and untracked files exist
  • A real build or test runs on the new Mac

The Guided Option: Codex Migrate

The guided option I built I ran into this problem myself, so I built Codex Migrate for this specific one-time Mac-to-Mac workflow. It transfers portable Codex state and selected workspaces directly between your Macs over SSH. It inventories dependencies, stages the transfer, preserves the destination Macโ€™s authentication and installation identity, requires a verified destination backup before replacement, and supports pause/resume and recovery after interruption.

  • Free MIT-licensed CLI and source
  • Signed and Apple-notarized Apple-silicon beta - $50 once, with direct best-effort support and a 30-day refund policy

The paid app and free CLI use the same migration engine and safety checks. Payment covers the packaged, signed workflow and maintainer support-not stronger data protection. Codex Migrate is an independent project. It is not affiliated with, supported by, or endorsed by OpenAI.

Keep Your Old Mac and an Independent Backup

Keep your old Mac and an independent backup until you have verified the result.

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.