Step 1
bin/magento maintenance:enable
I upgraded third-party packages and ensured that it does not break the website:
composer self-update
composer clear-cache
rm -f composer.lock
composer update --prefer-source
bin/magento setup:upgrade
rm -rf var/generation var/cache var/log var/page_cache var/view_preprocessed
bin/magento setup:di:compile
find var/* -type f -or -type d | grep -v 'session' | xargs rm -rf
rm -rf pub/static/*
bin/magento setup:static-content:deploy
bin/magento indexer:reindex
bin/magento cron:run
Step 2
I have installed the MDVA-532 patch: magento.com/tech-resources/download#download1892
It is recommended here: devdocs.magento.com/guides/v2.0/release-notes/tech_bull_21-upgrade.html#tb-upgr-nosamp
Step 3
I have upgraded Magento from 2.0.2 to 2.0.17 first.
Step 3.1
composer require magento/product-community-edition 2.0.17 --no-update
composer update --prefer-source
Step 3.2
chmod u+x bin/magento
It fixes the «Permission denied» failure on a «bin/magento
» command.
Step 3.3
rm -rf var/generation var/cache var/log var/page_cache var/view_preprocessed
It fixes failures like this: «Argument 1 passed to Magento\Framework\Url\HostChecker::__construct() must implement interface Magento\Framework\Url\ScopeResolverInterface, instance of Magento\Framework\ObjectManager\ObjectManager given».
Step 3.4
bin/magento setup:upgrade
Step 3.5
rm -rf var/generation var/cache var/log var/page_cache var/view_preprocessed
bin/magento setup:di:compile
Step 3.6
Step 3.7
find var/* -type f -or -type d | grep -v 'session' | xargs rm -rf
rm -rf pub/static/*
bin/magento setup:static-content:deploy
bin/magento indexer:reindex
bin/magento cron:run
Step 4
Then, I upgraded Magento from 2.0.17 to 2.1.11.
Step 4.1
composer require magento/product-community-edition 2.1.11 --no-update
composer update --prefer-source
Step 4.2
chmod u+x bin/magento
It fixes the «Permission denied» failure on a «bin/magento
» command.
Step 4.3
rm -rf var/generation var/cache var/log var/page_cache var/view_preprocessed
It fixes failures like this: «Argument 1 passed to Magento\Framework\Url\HostChecker::__construct() must implement interface Magento\Framework\Url\ScopeResolverInterface, instance of Magento\Framework\ObjectManager\ObjectManager given».
Step 4.4
bin/magento setup:upgrade
Step 4.5
rm -rf var/generation var/cache var/log var/page_cache var/view_preprocessed
bin/magento setup:di:compile
Step 4.6
Step 4.7
Step 4.8
Step 4.9
find var/* -type f -or -type d | grep -v 'session' | xargs rm -rf
rm -rf pub/static/*
bin/magento setup:static-content:deploy
bin/magento indexer:reindex
bin/magento cron:run
Step 4.10
How to fix the «Array to string conversion in Magento/Framework/DB/Adapter/Pdo/Mysql.php on line 2929» failure on a shipping address saving on the frontend checkoput page in Magento 2.1.x?How to fix the «Array to string conversion in Magento/Framework/DB/Adapter/Pdo/Mysql.php on line 2929» failure on a shipping address saving on the frontend checkoput page in Magento 2.1.x?
Step 5
Then, I upgraded PHP to 7.1.13.
How do I install PHP 7.1 FPM and CLI for Magento 2 to Debian 8 (Jessie)?
Step 6
Then, I upgraded Magento from 2.1.11 to 2.2.2.
Step 6.1
Step 6.2
composer require magento/product-community-edition 2.2.2 --no-update
composer update --prefer-source
Step 6.3
chmod u+x bin/magento
It fixes the «Permission denied» failure on a «bin/magento
» command.
Step 6.4
rm -rf var/generation var/cache var/log var/page_cache var/view_preprocessed
It fixes failures like this: «Argument 1 passed to Magento\Framework\Url\HostChecker::__construct() must implement interface Magento\Framework\Url\ScopeResolverInterface, instance of Magento\Framework\ObjectManager\ObjectManager given».
Step 6.5
bin/magento setup:upgrade
Step 6.6
rm -rf var/generation var/cache var/log var/page_cache var/view_preprocessed
bin/magento setup:di:compile
Step 6.7
Step 6.8
Step 6.9
Step 6.10
I have updated my Blank-inherited design theme:
The theme.js
and responsive.js
files of the Blank design theme has been moved to the Magento_Theme
folder since Magento 2.2.
Step 6.11
How to fix «Element ‘item’: This element is not expected» after upgrading Magento to 2.2?
Step 7.
bin/magento maintenance:disable