docs/src/content/en/guides/migrations/upgrade-to-v1/cli.mdx
The CLI has been simplified by removing deployment commands, configuration flags, and starter files. A new migration command has been added to help with database schema upgrades.
mastra migrate commandA new mastra migrate command helps run database migrations when upgrading Mastra versions. This is particularly useful when upgrading from older versions that may have data incompatibilities.
npx mastra migrate
The command bundles your project, connects to your configured storage, and runs any necessary migrations. Currently supports migrating duplicate spans entries that may prevent unique constraint creation.
See the Storage migration guide for details on when this migration is needed.
mastra deploy commandThe mastra deploy command has been removed from the CLI. This change simplifies the CLI by removing vendor-specific deployment logic.
To migrate, choose one of the deployment platforms of your choice.
--env flag from mastra buildThe --env flag has been removed from the mastra build command. This change simplifies the build command.
To migrate, use mastra start --env <env> to start the build output with a custom environment.
- mastra build --env production
+ mastra build
+ mastra start --env production
--port flag from mastra devThe --port flag has been removed from the mastra dev command. Port configuration is now handled through the Mastra instance configuration. This change centralizes port configuration.
To migrate, use server.port on the Mastra instance instead of the CLI flag.
const mastra = new Mastra({
server: {
port: 3001,
},
})
The telemetry option has been removed from CLI commands including the --no-telemetry / -nt flag. Telemetry configuration has been removed from the CLI. This change reflects the move of telemetry features to the observability package.
To migrate, remove telemetry flags from CLI commands. Use @mastra/observability for tracing features.