What steps do I need to follow to upgrade a demo installation with sample data from Magento 2.1 to the latest 2.2 version?
Instructions that work for Magento Commerce (Enterprise Edition) as well as Open Source (Community Edition) if possible.
1 Answer 1
Remove Magento 2.1 sample data modules:
bin/magento sampledata:removeIf you recieve an authentication error like this:
[Composer\Downloader\TransportException] The 'https://repo.magento.com/packages.json' URL required authentication. You must be using the interactive console to authenticateyou have to copy your stored credentials for repo.magento.com to
var/composer_homebecause this is the composer home directory forbin/magentocommandscp ~/.composer/auth.json var/composer_home/Specify new Magento version
For Open Source (CE):
composer require magento/product-community-edition 2.2.1 --no-updateFor Commerce (EE):
composer require magento/product-enterprise-edition 2.2.1 --no-update(Replace
2.2.1with the current version if there's a newer one)Update dev requirement versions
This is necessary if you use the testing tools bundled with Magento. The current required versions can be found here: https://github.com/magento/magento2/blob/2.2/composer.json#L76-L82
composer require --dev --no-update \ phpunit/phpunit ~6.2.0 \ squizlabs/php_codesniffer 3.0.1 \ pdepend/pdepend 2.5.0 \ friendsofphp/php-cs-fixer ~2.1.1 \ lusitanian/oauth ~0.8.10 \ sebastian/phpcpd 2.0.4 composer remove --dev --no-update \ fabpot/php-cs-fixer \ sjparkinson/static-reviewTrigger update
composer updateReview file permissions
You might need to set the correct file permissions again, for example make
bin/magentoexecutable:chmod +x bin/magentoAnd give appropiate write permissions to the new
generateddirectory.More info: http://devdocs.magento.com/guides/v2.2/install-gde/install/file-sys-perms-over.html
Reinstall sample data
bin/magento sampledata:deploy bin/magento sampledata:resetUpgrade database
bin/magento setup:upgradeCompilations
If in production mode, also run the following compilation commands:
bin/magento setup:di:compile bin/magento setup:static-content:deploy
Explore related questions
See similar questions with these tags.