2

Before magento 2.2 I emptied the var/generations folder during an upgrade of an extension or an update of magento from eg. 2.1.5 to 2.1.6

In 2.2 the var/generations folder is empty and replaced (I suppose) by the generated folder.

I always used this for upgrading (see below), but which commands to use in 2.2?

php bin/magento maintenance:enable

php bin/composer require myparcelnl/sdk "v1.3.0"
php bin/composer require myparcelnl/magento "2.3.0-beta.5"
php bin/composer update

rm -rf var/di/*; 
rm -rf pub/static/*; 
rm -rf var/generation/*; 
rm -rf var/view_preprocessed/*;
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -j 1
php bin/magento setup:static-content:deploy nl_NL -j 1
php bin/magento indexer:reindex
4
  • Yes as suggested by you the generations folder is moved in root magento as generated folder. You need to remove generated/code and generated/meta folders before any upgradation.
    – Priyank
    Commented Dec 1, 2017 at 9:39
  • Before or after the composer update? Commented Dec 1, 2017 at 9:44
  • Priyank, are the commands in the answer correct then? Commented Dec 1, 2017 at 11:50
  • There are .htaccess files which are required when you are using apache webserver so make sure they are not removed.
    – Priyank
    Commented Dec 1, 2017 at 12:02

1 Answer 1

4

So the correct commands are then:

php bin/magento maintenance:enable

php bin/composer require myparcelnl/sdk "v1.3.0"
php bin/composer require myparcelnl/magento "2.3.0-beta.5"
php bin/composer update

rm -rf pub/static/*; 
rm -rf var/view_preprocessed/*;
rm -rf generated/*;
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -j 1
php bin/magento setup:static-content:deploy nl_NL -j 1
php bin/magento indexer:reindex

php bin/magento maintenance:disable

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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