I tried to following steps to upgrade from 2.1.8 to 2.2.1 as mentioned in linked question:
bin/magento maintenance:enable
composer require magento/product-community-edition 2.2.0 --no-update
composer update
rm -rf var/cache/*
rm -rf var/page_cache/*
rm -rf var/generation/*
chmod +x bin/magento
bin/magento setup:upgrade
bin/magento maintenance:disable
but received the following error:
The requested package magento/product-community-edition 2.2.1 exists as magento/product-community-edition[2.1.8] but these are rejected by your constraint.
I can't see 2.1.8 anywhere in my composer.json file, but still received this error. Please let me know where should I fix?
Updating my Composer.json
file:
{
"name": "magento/project-community-edition",
"description": "eCommerce Platform for Growth (Community Edition)",
"type": "project",
"version": "2.2.1",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"require": {
"magento/product-community-edition": "2.2.1",
"composer/composer": "@alpha"
},
"require-dev": {
"phpunit/phpunit": "4.1.0",
"squizlabs/php_codesniffer": "1.5.3",
"phpmd/phpmd": "@stable",
"pdepend/pdepend": "2.4.0",
"fabpot/php-cs-fixer": "~1.2",
"lusitanian/oauth": "~0.3 <=0.7.0",
"sebastian/phpcpd": "2.0.0"
},
"config": {
"use-include-path": true
},
"autoload": {
"psr-4": {
"Magento\\Framework\\": "lib/internal/Magento/Framework/",
"Magento\\Setup\\": "setup/src/Magento/Setup/",
"Magento\\": "app/code/Magento/"
},
"psr-0": {
"": "app/code/"
},
"files": [
"app/etc/NonComposerComponentRegistration.php"
]
},
"autoload-dev": {
"psr-4": {
"Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/",
"Magento\\Tools\\": "dev/tools/Magento/Tools/",
"Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/",
"Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
"Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/"
}
},
"minimum-stability": "alpha",
…….
Best Answer
Step 1: Access Your Server via SSH
You need to connect your server via SSH.
Step 2: Navigate to the Magento 2 Root Directory
Once your SSH connection is up, you will need to move to your target application folder. In that application folder, you will find the public_html folder which is the root directory of Magento 2.
Step 3: Upgrade Commands
Then execute this all commands