The first step:
Before you do anything: go ahead and back up your store, we’ll need to back up the database and database, this should be a smooth upgrade but you never know (it’s Magento after all …) You will be grateful because you can downgrade to a functional version of Easily store your magento if an error occurs during the upgrade process. It’s important to back up your store for things like this, don’t underestimate the step!
You can do this with Magento CLI or, for your peace of mind, you may prefer to export the database manually.
We’ll assume you use a reasonable method to issue and maintain a magento store code base, such as GIT or SVN. We will be using GIT so we can create a new branch and use this branch to upgrade from Magento 2.2 to Magento 2.3 and test it before integrating it back into its main branch. Make sure to make a backup copy of composer.json on your warehouse.
The second step:
With the safely backed magento store, we can go ahead and start the upgrade process. It’s relatively easy in Magento 2 as most of it is processed by updating your composer file. This is generally done through the command line. Run the following commands to start the update process.
This will add new Magento 2.3 dependencies to your composer file:
composer require magento/product–community–edition=2.3.0 —no–update
|
This will add third party dependencies that the new 2.3 system uses:
composer require —dev phpunit/phpunit:~6.2.0 friendsofphp/php–cs–fixer:~2.10.1 lusitanian/oauth:~0.8.10 pdepend/pdepend:2.5.2 sebastian/phpcpd:~3.0.0 squizlabs/php_codesniffer:3.2.2 —no–update
|
This will remove some third party dependencies that are no longer used:
|
composer remove —dev sjparkinson/static–review fabpot/php–cs–fixer —no–update
|
Now open the composer.json file and add Zend\\Mvc\\Controller\\“: “setup/src/Zend/Mvc/Controller/ into the “psr-4” section.
The psr-4 section in your composer file should now look like the following:
|
“autoload”: {
“psr-4”: {
“Magento\\Framework\\”: “lib/internal/Magento/Framework/”,
“Magento\\Setup\\”: “setup/src/Magento/Setup/”,
“Magento\\”: “app/code/Magento/”,
“Zend\\Mvc\\Controller\\”: “setup/src/Zend/Mvc/Controller/”
},
...
}
|
Finally, you will need to change the “version” attribute of the composer.json file to 2.3.0, which is more for you and your friends than developers the next time you open this composer file, they will not be confused with the wrong version numbers.
… Now, for a moment of truth, to tell the composer to install and update new dependencies, we are working on the command line:
Composer update
Composer update
Once complete, you will need to delete the var cache and the created directories. If you are using Redis or Memcached, you will need to empty this cache.
rm -rf var / cache / *
rm -rf var / cache / *
rm -rf var / page_cache / *
rm -rf var / page_cache / *
rm -rf generated / code / *
rm -rf generated / code / *
Finally, start installing and upgrading scripts with:
Php bin / magento configuration: update
The third step:
Congratulations! Your store should now upgrade to Magento 2.3.
If I visited your website and received a PHP syntax error, it looks like “unexpected syntax error”? “Expect variable (T_VARIABLE)” or error 500, try checking / changing your PHP version to 7.1.3+, this is a new requirement for Magento 2.3. If you are running Magento 2.2 in PHP 7.0.13, this may be a common update problem.
However, the most often overlooked step is to check for third-party or custom extensions that you have installed that don’t have any code changes disabled / disabled. This update is completely distorted and does not contain many urgent changes, but be sure to check out the list of official Magento 2.3 changes.