> ## Documentation Index
> Fetch the complete documentation index at: https://docs.specpilot.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# specpilot migrate

> Convert an old .project-spec/ folder to .specs/, or rename Cursor's old rules file. Rarely needed.

```bash theme={null}
specpilot migrate [options]
```

Alias: `specpilot m`. For a project without specs, use [`specpilot add-specs`](https://docs.specpilot.dev/reference/cli/add-specs) instead.

## Options

| Option | What it does | Default |
| - | - | - |
| `-d, --dir <directory>` | The project folder | `.` |
| `--from <structure>` | `complex` or `project-spec`. Both read `.project-spec/` | `complex` |
| `--to <structure>` | `simple`, which is `.specs/` | `simple` |
| `--backup` | Copies the project first | Off |
| `--cursor-rules` | Only renames Cursor's old rules file. See below | Off |
| `--remove-old` | With `--cursor-rules`, when both rules files exist, removes the old one | Off |

## What it does

It copies each file in `.project-spec/` to its place in `.specs/`, merges where a file is already there, and creates a stub for each file that's missing.

It stops if `.specs/` already exists, or if there's no `.project-spec/`.

`--backup` copies the whole project folder, `node_modules` included, to `backup-<timestamp>/` first.

## Afterwards

Run `specpilot validate --fix`, which creates the security files, then [`specpilot backfill`](https://docs.specpilot.dev/reference/cli/backfill). See [Upgrading](https://docs.specpilot.dev/help/upgrading.md).

## The old Cursor rules file

Projects set up before SpecPilot 2.1.0 have Cursor's rules in `.cursor/rules/project.mdc`. Now they belong in `.cursor/rules/specpilot.mdc`. `specpilot validate`, `specpilot backfill` and `specpilot serve` warn when the old file is still there.

* `--cursor-rules` renames `project.mdc` to `specpilot.mdc`. It never writes over an existing `specpilot.mdc`.
* If both files exist, Cursor loads the rules twice. `--cursor-rules --remove-old` removes `project.mdc`. First it lists any lines that are only in the old file.

A `project.mdc` without SpecPilot's front matter is your own rule and is left as it is. With `--cursor-rules`, `--from`, `--to` and `--backup` don't apply. It exits `1` when it can't do it, with the reason.

In the App, the [Instructions view](https://docs.specpilot.dev/app/spec-views.md#file-views) has the same fixes.

## Examples

```bash theme={null}
specpilot migrate --backup
specpilot migrate --cursor-rules
```

Checked against SpecPilot 2.22.0.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.