With all the new stuff coming to Magento 2.3.0 you might want to try out the upgrade process to the latest 2.3.0-alpha release. Before you start, make sure that your existing store is running on php 7.1. In our below example we start with Magento 2.2.5.
Using Composer to grab the latest package
composer config minimum-stability alpha
composer require magento/product-community-edition:2.3.0-alpha --no-update
Ideally we should now be able to just run
composer update
Unfortunately this is not to be and we would run into something like the following:
The issue in this case is that when we initially create a Magento 2 project we copy the main composer.json
file and make this our own. It is not automatically upgraded for us during the upgrade process with any changes needed. For the 2.3.0 release there are few changes that need to be made to this file before we can proceed with the upgrade.
While the github repo is generally a good place to check what code changes are in a particular version in this case we need to know exactly what is in repo.magento.com for the package magento/project-community-edition
. This information is not available as a tagged release on github. I have gone through the installation of 2.2.5 and 2.3.0-alpha and compared the resulting composer.json files when doing a fresh installation of 2.2.5 and 2.3.0-alpha. You can view the differences here.
To get our existing composer.json to match we need to make a few amendments:
composer config preferred-install dist
composer config sort-packages true
composer config prefer-stable true
composer require --dev friendsofphp/php-cs-fixer:~2.10.0 --no-update
composer require --dev sebastian/phpcpd:~3.0.0 --no-update
php -r '$autoload=json_decode(file_get_contents("composer.json"), true); $autoload["autoload"]["psr-4"]["Zend\\Mvc\\Controller\\"]= "setup/src/Zend/Mvc/Controller/"; file_put_contents("composer.json", json_encode($autoload, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES));'
This now gets us to a stage where we can run
composer update
and we can see the upgrade process hapenning:
Any errors at this stage are then likely caused by extensions that would need to be upgraded at the same time as Magento to stay compatible.
Now that we have the latest code the only thing left to do is make sure that the database itself is also upgraded with
bin/magento setup:upgrade
And et voilĂ we can confirm in the admin that we are using 2.3.0-alpha
Sidenote
For all fans of bundled extensions you'd be surprised to see that these are currently getting removed during the upgrade