craftcms / craft6-revamp
Craft 6 project prepper
Requires
- php: ^8.2
- composer/semver: ^3.4
- illuminate/filesystem: ^12.0
- illuminate/support: ^12.14.1
- laravel/prompts: ^0.1.18|^0.2.0|^0.3.0
- symfony/console: ^6.2|^7.0
- vlucas/phpdotenv: ^4.0|^5.0
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^10.4
README
This CLI tool automates a number of steps in the Craft 6 upgrade process.
Tip
Keep an eye on our Planning for the Laravel Transition article for complete upgrade instructions, as the first Alpha release approaches!
Summary of actions 🪄
The following tasks are handled by the script. A description of each action is output to the console, followed by a confirmation or error message.
You will be prompted before the tool takes potentially destructive actions.
- Verifies you’re running a supported version of Craft 5;
- Updates Composer dependencies for Craft and the Generator, adds craftcms/yii2-adapter, and removes vlucas/phpdotenv;
- Switches the DDEV project type to
laravel, and updates the project’s PHP version; - Renames a handful of environment variables to match Laravel conventions;
- Creates the
artisanCLI entrypoint, Laravel’sbootstrap/files, and replacesindex.php; - Scaffolds Laravel’s
framework/directory; - Moves existing Craft-specific configuration files into
config/craft/; - Renames the web root to
public/; - Renames the
translations/directory tolang/; - Removes
boostrap.php;
A few manual follow-up actions are then suggested, when relevant to your project.
Caution
Make sure you have a way to restore your project, if you encounter issues. Use this tool at your own risk, and do not run this on your live server! It is only intended to upgrade projects in a development environment.
Installation
The tool is installed as a global Composer package, on any system running PHP 8.2 or newer.
composer global require craftcms/craft6-revamp -W
DDEV or Docker users: it is safe to do this from any directory on your host machine.
It should not alter your project’s composer.json.
If you get a dependency conflict error, try running the following command first:
composer global update
Usage
To prepare an existing Craft 5 project for Craft 6, run the tool from its root directory:
craft6-revamp
The tool will exit if it can’t find composer.json and composer.lock files, or if it can’t confidently determine the project is compatible.
If the command doesn’t resolve (say, because your user’s Composer bin directory is not in your $PATH), you can run the command directly:
~/.composer/vendor/bin/craft6-revamp
You may also pass a --path, if you have many projects to update:
craft6-revamp --path /path/to/project