# Migrating an existing project 1. Preserve all existing scripts and Compose data. 2. Run `devfn init`, inspect confirmed versus proposed detections, then rerun with `--yes` only when the preview is truthful. 3. Edit the manifest so every command, dependency, port, profile, and health check is explicit. 4. Run `devfn doctor --trust`; address missing runtimes and exact-port conflicts. 5. Before the first start, back up every pre-existing file targeted by `environmentOutputs[].path`; DevFn overwrites configured outputs and cannot restore prior contents. 6. Start with a minimal profile and compare it with the existing manual startup flow. 7. Add full, OAuth, test, or docs profiles incrementally. Public tunnels must remain explicit. 8. Verify `devfn down` preserves databases and volumes before adopting it as the daily command. Existing receipts, leases and routes belong to the default runtime, which keeps the v0.1 instance identity, so upgrading adopts a running lifecycle as it is. Before starting a named runtime (`--runtime `) beside it, give every `environmentOutputs[].path` a `{runtime}` file-name token and choose `artifacts` for Wrangler, Xcode and extfn processes. Rollback by running `devfn down` (and `devfn down --runtime ` for each runtime `devfn runtimes` lists), then inspect `runtimeDir` and every `environmentOutputs[].path` in the manifest before removing generated files. The default generated location is `.devfn/`, but custom paths may live elsewhere. Preserve any target that existed before DevFn adoption; cleanup does not know whether a configured output replaced user-owned content. Finally remove the DevFn manifest and continue using the preserved original scripts. Docker volumes and source configuration are not deleted.