0

I want to update from Magento 2.0.4 to latest version. I want to know commands, and which folders are going to modify in the update process. all I want command line based update process.

Note: I directly override some file in vendor, is it safe to update? and how to manage those override files.

  • what kind of files did you change? – Greg Feb 23 '18 at 10:56
  • some css, php code like, making image more larger than 1200px . in vendor and some in lib – Ganesh Godshelwar Feb 23 '18 at 10:58
  • I would strongly suggest to overwrite those files in your custom theme or create modules to handle changes. They will get overwritten with an update. See my answer. – Greg Feb 23 '18 at 11:00
  • ok thanks lot , i will make in custom theme. then update to latest version – Ganesh Godshelwar Feb 23 '18 at 11:04
  • Please do, otherwise you will loose all the changes you have done. – Greg Feb 23 '18 at 11:06
1

I would strongly suggest to do a backup before you do the upgrade. Test everything before upgrading the production site. Make sure that all third party modules are compatible with this version of Magento.

If you made any changes directly to core files and didn't overwrite them using best practises, those changes will be lost. Make sure you overwrite them properly in your custom theme or modules.

Navigate to SSH and run:

composer require magento/product-community-edition 2.2.2 --no-update
composer update
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento indexer:reindex
1

Run below commands from your Magento 2 root directory.

composer require magento/product-community-edition 2.2.2 --no-update
composer update 
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento indexer:reindex

Note: Those overrides you need to do in your custom extension or theme

  • note: i directly override some file in vendor, is it safe to update? and how to manage those override files. can you give brief about this. and what is mean by 2.2.2 " --no-update " – Ganesh Godshelwar Feb 23 '18 at 10:53
  • Those overrides you need to do in your custom extension or theme. – Kishan Patadia Feb 23 '18 at 10:53
  • And then you can safely upgrade – Kishan Patadia Feb 23 '18 at 10:53
0

First check your custom extension and theme compatible with latest magento version or not.

=============================================================================

upgrade magento version Step By Step run following command

composer require magento/product-community-edition 2.2.2 --no-update
composer update
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile(Optional)
php bin/magento indexer:reindex
php bin/magento setup:static-content:deploy

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

php bin/magento --version
0

All custom changes should be done either inside your custom composer module that loaded to vendor, or inside a module that is stored under app/code

Any changes to vendor modules will be lost during composer update process. (Or it will not let you update, as you have modified files there.)

When your customisations are safely separated and tested you can run:

(if you need to put store to maintenance mode, enable it)

php bin/magento maintenance:enable

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

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

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
php bin/magento indexer:reindex

php bin/magento maintenance:disable

more info: http://devdocs.magento.com/guides/v2.0/comp-mgr/cli/cli-upgrade.html

or you can do it via admin: http://devdocs.magento.com/guides/v2.0/comp-mgr/upgrader/upgrade-start.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.