Because of solidity Magento 2 it’s not very easy to switch from one version to the other one even though it’s newer. From the tutorials below you will find the easiest and very effective way to get your Magento 2 upgrade to the latest available version. Please refer to the video tutrials and manual below.
Below are the commands used in the tutorials to get Magento 2 upgrade on Digital Ocean environment with Ubuntu/Debian OS:
Enabling new repository, execute:
sudo add-apt-repository ppa:ondrej/php sudo apt-get update Installing php7: apt-get install php7.0 apt-get install php7.0-mysql
Installing required php libraries, execute:
apt-get install php7.0-gd php7.0-mcrypt php7.0-curl php7.0-intl php7.0-xsl php7.0-mbstring php7.0-zip php7.0-soap
Upgrading default version of Magento2 to the latest one via composer.
Below commands should be executed from the root directory of your Magento installation, execute:
composer require magento/product-community-edition 2.1.7 - -no-update composer update rm -rf var/di var/generation 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
After upgrade, check your Magento 2 version with the following command, execute:
php bin/magento --version
Setting right ownership to the files, execute:
chown -R magento:www-data * Disabling php5 and enabling php7: a2dismod php5 a2enmod php7.0
Restarting Apache to apply new changes, execute:
service apache2 restart
It should have been upgraded!