Skip to main content

Magento2 Upgrade current installation using command line

Hello In this wiki i will show you how to upgrade magento to  (CC 2.3.6) version by Command line

Please follow these steps 

direct use of composer.phar

 

To see the full list of available 2.3 versions:

composer show magento/product-community-edition 2.3.* --available | grep -m 1 versions

 

To see the full list of available 2.4 versions:

composer show magento/product-community-edition 2.4.* --available | grep -m 1 versions

 

 

php composer.phar require magento/product-community-edition 2.3.4 --no-update

php composer.phar  update

 

with only composer

composer require magento/product-community-edition 2.3.4 --no-update
composer update  

php bin/magento setup:upgrade
php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento setup:di:compile
php bin/magento indexer:reindex

 

Specify additional packages when upgrading from 2.2.x => 2.3.x

composer require --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 --sort-packages --no-update

 

Remove unused packages when upgrading from 2.2.x => 2.3.x

composer remove --dev sjparkinson/static-review fabpot/php-cs-fixer --no-update

 

Example - Security patch

composer require magento/product-community-edition=2.3.3-p1 --no-update

 

Example Update from 2.2.11 => 2.3.0

1 - php composer.phar require magento/product-community-edition=2.3.0 --no-update
2 - php composer.phar 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
3 - php composer.phar remove --dev sjparkinson/static-review fabpot/php-cs-fixer --no-update
4- Open composer.json file to add “Zend\\Mvc\\Controller\\”: “setup/src/Zend/Mvc/Controller/”: around line 47 under psr-4 section.

"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/"

    },

    ...

}

 

 

 

popular issues 

 

File : composer.phar

 

List of Magento versions 

  1. ver 2.4.1
  2. ver  2.4.0-p1
  3. ver 2.4.0
  4. ver 2.3.6
  5. 2.3.5-p2
  6. 2.3.5-p1
  7. 2.3.4-p2
  8. 2.3.4
  9. 2.3.3-p1
  10. 2.3.3
  11. 2.3.2-p2
  12. 2.3.2
  13. 2.3.1
  14. 2.3.0