How to update magento2 from 2.0.0 to 2.0.2

Updating/Upgrading to Magento 2.0.2 (via composer)

php bin/magento maintenance:enable
composer require magento/product-community-edition 2.0.2 --no-update
composer update
rm -rf var/di var/generation
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento indexer:reindex
php bin/magento maintenance:disable

After upgrade, check your Magento version with the following command:

php bin/magento --version

Upgrading to Magento 2.3.x

The above commands work fine while upgrading Magento to 2.2.x.

To upgrade to Magento 2.3.x, you need to follow some more steps.

Here's the step-by-step guide to upgrade Magento to 2.3.x:

Enable maintenance mode

php bin/magento maintenance:enable

Specify Magento packages

composer require magento/product-community-edition=2.3.0 --no-update

Specify additional packages

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

Remove unused packages

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

Update autoload

Open composer.json and edit the "autoload": "psr-4" section to include "Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/":

"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/"
    },
    ...
}

Apply updates

composer update

Clean the Magento cache

php bin/magento cache:clean

Manually clear caches and generated content

Clear the var and generated subdirectories:

rm -rf <Magento install dir>/var/cache/*
rm -rf <Magento install dir>/var/page_cache/*
rm -rf <Magento install dir>/generated/code/*

or Single Line

rm -rf var/cache/* generated/code/* var/view_preprocessed/* var/page_cache/* var/report/* pub/static/frontend/* pub/static/adminhtml/* pub/static/_cache/merged/*

If you use a cache storage other than the filesystem, such as Redis or Memcached, you must manually clear the cache there too.

Update the database schema and data

php bin/magento setup:upgrade

Disable maintenance mode

php bin/magento maintenance:disable

Finally, check your Magento version

php bin/magento --version

Read more: https://devdocs.magento.com/guides/v2.3/comp-mgr/cli/cli-upgrade.html


The recommended way in the documentation is via admin:

System > Web Setup Wizard > System Upgrade.

(http://devdocs.magento.com/guides/v2.0/comp-mgr/upgrader/upgrade-start.html)

You must have crons enabled or it will not work. Make sure in configuration you have your keys inserted. If it freezes with no output in the logs you can check the php logs to see if it timed out and then increase the memory_limit in .htaccess to 2G.

The second way is with composer:

In composer.json change this line

"magento/product-community-edition": "2.0.0",

Also you should change the line 5 as well "version": "2.0.0", to keep it in sync.

to whatever version you want, and then run:

composer update
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy

Just upgraded successfully to Magento 2.2.6 through composer:

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

Change the version accordingly e.g. 2.2.6

composer update
rm -rf var/di var/generation/* var/view_preprocessed/* var/cache/* var/page_cache

*// The issue following commands one by one

chown -R user:group .
chmod u+x bin/magento
php bin/magento cache:flush
php bin/magento setup:upgrade
ph bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
php bin/magento indexer:reindex

If getting permissions error, issue:

chown -R user:group .

command again where user and group correspond to your server user and user group.