# Running legacy migration scripts

If you have migration scripts written for the old `datocms-client` package, you don't need to convert them to the latest `@datocms/cma-client` package.

You can simply move them to a `legacyClient` directory:

Terminal window

```bash
mkdir migrations/legacyClient
mv migrations/*.js migrations/legacyClient
```

The CLI will take care of passing those migration scripts to the old API client, while all the new migration scripts will be written directly in the `migrations` directory, and will use the new API client.

## Related content in "Environments and migrations"

- [Introduction to Environments & Migrations](https://www.datocms.com/docs/scripting-migrations/introduction.md)

- [Safe iterations using environments](https://www.datocms.com/docs/scripting-migrations/safe-iterations-using-environments.md)
- [Configuring the CLI](https://www.datocms.com/docs/scripting-migrations/installing-the-cli.md)

- [Write and test migration scripts](https://www.datocms.com/docs/scripting-migrations/scripting-migrations-with-the-datocms-cli.md)
- [Apply migrations to primary environment](https://www.datocms.com/docs/scripting-migrations/apply-migrations-to-primary-environment.md)

- [Running legacy migration scripts](https://www.datocms.com/docs/scripting-migrations/running-legacy-migrations.md)
- [Keeping multiple DatoCMS projects in sync](https://www.datocms.com/docs/scripting-migrations/keeping-multiple-datocms-projects-in-sync.md)