craftcms / craft6-revamp
Craft 6 upgrade tool
Requires
- php: ^8.2
- composer/semver: ^3.4
- illuminate/filesystem: ^12.0
- illuminate/support: ^12.14.1
- laravel/prompts: ^0.3.15
- symfony/console: ^6.2|^7.0
- symfony/yaml: ^7.0
- vlucas/phpdotenv: ^4.0|^5.0
Requires (Dev)
- laravel/framework: ^12.0
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^10.4
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-10 17:13:26 UTC
README
This CLI tool automates a number of steps in the Craft 6 upgrade process.
Tip
Craft 6 is in alpha. Follow the Upgrading to Craft 6.x guide for complete upgrade instructions: it covers preparing your project, running this tool, and what to check afterwards. See Planning for the Laravel Transition for the release timeline and plugin compatibility.
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.
Before you start
The tool changes files, not your database or your servers. Before running it:
- Update the project to the latest Craft 5 release (5.9.0 or later is required), and plugins to their latest versions;
- Resolve outstanding deprecation warnings;
- If you want to control how category groups, tag groups, and global sets become entries, run the
php craft entrify/*commands on Craft 5 now; - Let the queue finish: the queue table is rebuilt during the upgrade, and pending jobs are lost;
- Back up your database, and commit (or stash) your code changes, so you can review and undo what the tool changes.
What it does
Each action is printed to the console, followed by a confirmation, a warning, or “Nothing to do” when it doesn’t apply to your project.
Checks, before anything changes
You will be prompted before the tool takes potentially destructive actions, and can cancel at any of these points:
- Verifies the project has
composer.jsonandcomposer.lockfiles, and runs Craft 5.9.0 or later; - Asks before continuing if the project has uncommitted Git changes;
- Asks before continuing if
bootstrap/orconfig/craft/already exist, which means the tool has probably run before. Steps that already happened are skipped, and files they created aren’t updated; - Lists the packages in
composer.lockthat requirecraftcms/cms(plugins, and packages likecraftcms/generator), and whether Packagist has a version of each that supports Craft 6. This is only a report; it’s skipped when Packagist can’t be reached. Filesystem, mail transport, and logging plugins are flagged as probably no longer needed, since Laravel disks, mailers, and logging channels replace them; - Warns about category groups, tag groups, and global sets, and prints the
php craft entrify/*commands to convert them to entries on Craft 5; - Finds the web root, and asks whether to rename it to
public/; - Shows the lines of a customized
index.phporbootstrap.phpthat will be lost, then asks to proceed.
Changes
composer.json: requirescraftcms/cms^6.0.0-alpha.1and craftcms/yii2-adapter, updatescraftcms/generatorto3.x-devif it’s installed, removes vlucas/phpdotenv,yiisoft/yii2-shell(useartisan tinkerinstead), and theconfig.platform.phpoverride, and adds Laravel’spost-autoload-dumpscripts;- DDEV: switches the project type to
laravel, sets PHP 8.5, and updates the docroot when the web root is renamed; - Environment variables: in
.env,.ddev/.env,.ddev/.env.web, and the.env.example*files, renames theCRAFT_DB_*variables to Laravel’sDB_*ones (includingCRAFT_DB_TABLEandCRAFT_DB_TABLE_PREFIXtoDB_TABLE_PREFIX),CRAFT_DEV_MODEtoAPP_DEBUG, and removesCRAFT_SECURITY_KEY. SetsAPP_ENVfromCRAFT_ENVIRONMENT(devbecomeslocal) andAPP_URLfromPRIMARY_SITE_URL; - OAuth keys: moves
oauth-private.keyandoauth-public.keyintostorage/ifCRAFT_STORAGE_PATHpointed somewhere else, so Laravel Passport keeps accepting tokens issued by Craft 5; - Laravel files: creates the
artisanCLI entrypoint,bootstrap/app.php, thestorage/framework/folders, and Laravel’s default config files inconfig/(existing files are kept); - Craft config: moves Craft’s config files into
config/craft/. Ingeneral.php(andgeneral.web.php/general.console.php), rewrites paths based ondirname(__DIR__)orCRAFT_BASE_PATHtobase_path()orpublic_path(), and removes theomitScriptNameInUrls,pathParam, andenableTwigSandboxsettings; - Project layout: renames
translations/tolang/, movestemplates/toresources/views/(asking first if it already exists), and renames the web root topublic/; - Entrypoints: replaces
index.php, and removesbootstrap.phpand thecraftCLI entrypoint (which is re-created the first time you publish vendor assets); .gitignore: adds/public/vendor/craft,/public/storage, and/storage/*.key.
Next steps
Finally, the tool lists the follow-up actions that apply to your project, such as:
- Laravel disks to add to
config/filesystems.php, based on your Craft filesystems; - The Laravel mailer that replaces your email transport;
- Settings and paths the tool couldn’t update safely;
- General config settings that moved into Laravel config (
timezone,defaultCookieDomain,blowfishHashCost,phpSessionName,systemMessageTemplate,elevatedSessionDuration, andtestToEmailAddress), and where each one goes now; - References to the renamed
CRAFT_DB_*,CRAFT_DEV_MODE, andCRAFT_SECURITY_KEYvariables in config files,.github/,docker-compose*.yml,Dockerfile*,.platform*,fly.toml, andrender.yaml; - Multi-environment config arrays, app-type config files,
db.php, Yii components and modules inapp.php, URL rules inroutes.php, and custom HTMLPurifier configs; - Plugins without a Craft 6 version, and plugins that Laravel configuration replaces;
composer update(which also publishes Craft’s assets and config viaartisan craft:setup:publish),artisan key:generate, andartisan craft:upto run Craft 6’s migrations.
What it doesn’t do
The tool only prepares your local project’s files. You’re responsible for:
- Your database. The tool doesn’t touch it, and doesn’t run migrations itself.
artisan craft:upis the last of its next steps; - Plugins. The tool reports which plugins have a Craft 6 version, but doesn’t change their constraints in
composer.json, or remove or replace them. During the alpha, you may need to setCRAFT_DISABLED_PLUGINS="*"or uninstall incompatible plugins before upgrading; - Categories, tags, and global sets. The tool doesn’t entrify them; run the
php craft entrify/*commands on Craft 5 first if you want to; - Customized entrypoints. Lines you added to
index.phporbootstrap.php(like PHP constants or custom environment loading) are shown, then removed; you’ll need to find Laravel equivalents; - Config it can only flag. Filesystems, mail, multi-environment configs, app-type configs,
db.php, Yii components and modules, URL rules, and HTMLPurifier configs are listed as next steps, not converted. Paths ingeneral.phpthe tool doesn’t recognize are left as they are, and the suggested disks keep Craft aliases other than@webroot,@web,@root, and@storagefor you to replace; - Templates and custom code. Twig templates, modules, and other PHP code aren’t changed.
craftcms/yii2-adapterkeeps them working, and Craft logs deprecation warnings for what to update. Don’t remove the adapter until they’re resolved; - Non-standard project layouts. The tool expects Craft 5’s default
config/,templates/, andtranslations/folders. Custom locations (such asCRAFT_TEMPLATES_PATH) aren’t followed; - Other environments. Only local files change. Update
.envfiles, OAuth keys (PASSPORT_PRIVATE_KEYandPASSPORT_PUBLIC_KEY), web server document roots, PHP versions outside DDEV, deployment scripts, cron jobs, and queue workers on your servers yourself; - Backups. The tool doesn’t keep a copy of what it changes. Use Git (or another backup) to review and undo its changes.
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 project path, if you have many projects to update:
craft6-revamp /path/to/project