rustydocs
Guides

Migrate from Cargo

Convert an existing Cargo workspace to rusty.json and rusty.lock.

rusty can adopt an existing Cargo project without rewriting sources. Migration produces rusty.json and rusty.lock while preserving your crate layout.

Check first

Preview what migration would do:

rusty migrate --dry-run

Interactive migration

On a TTY, rusty migrate explains the conversion and asks for confirmation:

rusty migrate

Non-interactive (CI)

rusty migrate --yes

Without a TTY, --yes is required or the command exits with an error.

Automatic prompts

Several commands detect an unmigrated Cargo tree and offer migration before proceeding:

  • rusty init inside a directory with Cargo.toml
  • rusty lock, rusty add, rusty build, rusty test (with interactive migration allowed)

Declining migration leaves the project on Cargo manifests; rusty continues to use cargo passthrough with CAS-backed CARGO_HOME.

After migration

  1. Review generated rusty.json and rusty.lock.
  2. Run rusty fetch to ingest dependencies into the store.
  3. Run rusty build and rusty test to validate the native driver path.
  4. Commit the new manifest files when satisfied.

If the project is already rusty-native, rusty migrate exits with an error — there is nothing to convert.

Lockfiles

BeforeAfter
Cargo.toml + Cargo.lockrusty.json + rusty.lock

rusty lock regenerates the appropriate lockfile for whichever format the project uses.

Rolling back

Keep the git history. To revert, restore Cargo.toml / Cargo.lock from before migration and remove rusty.json / rusty.lock. The CAS contents in ~/.rusty/ are safe to retain — they are content-addressed and reusable.

On this page