The docs here say that you should use the system upgrade utility: http://devdocs.magento.com/guides/v2.0/comp-mgr/upgrader/upgrade-start.html and do it from the admin.
I thought that you would be able to update it by changing the composer.json file to "version": "2.0.2", and then just run composer update.
Would this be another way to update or system upgrade utility is the only way of doing it?
-
Not sure if you come across this guide magecomp.com/blog/upgrade-magento-2-x-to-latest-versionGaurav Jain– Gaurav Jain2018年05月04日 06:59:16 +00:00Commented May 4, 2018 at 6:59
-
goivvy.com/blog/magento-2-upgrade may help someonematinict– matinict2018年09月24日 05:27:56 +00:00Commented Sep 24, 2018 at 5:27
10 Answers 10
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
-
Also need to change "version": "2.0.2"Praful Rajput– Praful Rajput2017年03月27日 09:22:36 +00:00Commented Mar 27, 2017 at 9:22
-
I successfully upgrade my Magento from Magento 2.1.0 to 2.1.6 but there is a problem in CSS. I can't fetch my CSS. All comes in Straight line. Errror:-GET 127.0.0.1/fuelpump/pub/static/frontend/fuelpump-new/theme/en_US/… (index):20 GET 127.0.0.1/fuelpump/pub/static/frontend/fuelpump-new/theme/en_US/… @Mukesh ChapagainJaimin– Jaimin2017年05月16日 10:12:51 +00:00Commented May 16, 2017 at 10:12
-
Will it upgrade sample data as well ?Slimshadddyyy– Slimshadddyyy2017年09月28日 05:56:22 +00:00Commented Sep 28, 2017 at 5:56
-
if you are looking proper solution visit this page codedecorator.com/magento-2-upgrade-service.htmlBhupendra Jadeja– Bhupendra Jadeja2022年02月07日 10:03:03 +00:00Commented Feb 7, 2022 at 10:03
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
-
3Probably doesn't matter but are you supposed to change the version in line 5 as well? "version": "2.0.0"Alex– Alex2016年03月31日 09:33:30 +00:00Commented Mar 31, 2016 at 9:33
-
Does upgrading from older to newer version affects Data Loss? We have to take backup before Upgrading?Jackson– Jackson2016年09月15日 06:39:29 +00:00Commented Sep 15, 2016 at 6:39
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.
-
awesome just searched for that because setup wizard failed to upgrade with no reason. this works for me!user45793– user457932016年10月13日 13:39:18 +00:00Commented Oct 13, 2016 at 13:39
You can upgrade Magento 2 version via admin panel or from terminal area Upgrade :
Admin Area Upgrade
Navigate to System> Web Setup Wizard> System Upgrade
Terminal Area Upgrade
Before you start please apply the MDVA-532 patch, open your terminal and enter this:
composer require magento/product-community-edition 2.1.0 --no-update
composer update
Next enter the following line to update the database schema and data.
php bin/magento setup:upgrade
Reference source which I followed to upgrade magento 2 version on my site (with screenshot and step by step) http://magentoexplorer.com/how-to-upgrade-magento-2-version-via-backend-or-terminal
Changing version and running composer update is for those who have access to command line, and have experience in using command lines(developers and SIs). The upgrade via admin is mainly for those who may have limited technical abilities or no access to command line via their hosting provider.
With version 2.0.2, fix is to upgrade the Magento installer first and then to force the upgrade of the core.
composer require magento/magento-composer-installer
composer require magento/product-community-edition '2.0.*' --no-update
composer update
And when you're done upgrading all PHP packages, make sure to run all Magento update scripts so that the database is up-to-date as well:
./bin/magento setup:upgrade
Go to the root directory of your store and run these commands:
composer require magento/product-community-edition 2.0.2 --no-update
You can change the version
composer update
rm -rf var/di/* var/generation/* var/cache/* var/log/* var/page_cache/*
php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento indexer:reindex
Just in case composer and Web Wizard ways fail there is a third approach:
- Download the latest Magento 2 of the official website.
- Unzip it into your main Magento directory.
- Run:
php bin/magento setup:upgradeandphp bin/magento deploy:mode:set production.
Take from this source.
One can upgrade magento 2 using the two basic methods, one is from admin panel and other is using composer
Would this be another way to update or system upgrade utility is the only way of doing it?
Definitely this isn't the only way.
- There first option is that you need to create a new website on Magento version 2.0.2, then migrate all your data from your current website on the Magento old version to the new one.
- You can choose a Composer update, you have to change the line:
"magento/product-community-edition": "2.0.0"in composer.json
Beside, you need to keep it in sync by changing the line 5 to "version": "2.0.0".
And finally, you must run this command:
composer update
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy