Is it possible to downgrade Magento from 2.3.4
to 2.2.1
? Which command should I use?
2 Answers
composer require magento/product-community-edition 2.2.1 --no-update
composer update
php bin/magento setup:di:compile
php bin/magento setup:upgrade
php bin/magento static:content:deploy
But be aware, some db problems may occurs. So you should not do it on your Live environment without testing somewhere else.
Short answer, you can't without a db backup. I tried this and had issues. It looked like it had worked but numerous issues occurred as I tested. I had a snapshot to go back to. Otherwise you are just going to have to export all your products, order data, etc and start fresh.
You should have a composer.json.bak that you should use from when you upgraded. If not you need to remove the packages from composer.json that you added in for the 2.3.4 upgrade.
composer remove --dev allure-framework/allure-phpunit:~1.2.0 friendsofphp/php-cs-fixer:~2.14.0 lusitanian/oauth:~0.8.10 magento/magento-coding-standard:~3.0.0 magento/magento2-functional-testing-framework:2.4.5 pdepend/pdepend:2.5.2 phpmd/phpmd:@stable phpunit/phpunit:~6.5.0 sebastian/phpcpd:~3.0.0 squizlabs/php_codesniffer:~3.4.0 --no-update
composer require magento/product-community-edition 2.2.1 --no-update
composer update
php bin/magento setup:di:compile
php bin/magento setup:upgrade
php bin/magento static:content:deploy
composer require magento/product-community-edition 2.2.1 --no-update composer update