How to Upgrade from Magento 2x to the Latest Version

Just because of the regular updates by Magento, different Magento stores become secure from the possible attacks. Every Magento update comes with new features and plenty of security updates. Hence, it is important to stay up-to-date with Magento to use its latest features to the maximum advantage and to protect your Magento stores for the potentials attacks.

Not updating your Magento web store can result in store’s low performance and it can even be easily targeted by hackers who are looking for a loophole to harm your store. Before you go for updating from Magento 2x to any of the latest versions, you must follow these basic steps for a smooth and effective update:

  1. There has to be the backup for both files and databases so that your data can be restored easily in case anything wrong happens while updating.
  2. Go through the release notes of the version to learn about the changes and features that have been introduced.
  3. Stay calm and composed while updating your store as it needs to be done carefully with the right commands.
  4. It is recommended to test the update in a staging environment just to be sure that all the aspects of your e-commerce store are compatible with the latest version.

Upgrade from Magento 2x to the latest version

You can use any of the two methods for upgrading from Magento 2x to the latest version.

Preferred Method

Log into SSH

After navigating to the public directory.

cd public_html in this case run the below. (change to latest version)

composer require magento/product-community-edition 2.2.1 –no-update
composer update

Problem Solving.

If you run into problems like this, disable or remove any extensions you have and try again. In this case we had installed the database migration tool that was specific to the version we had installed so I deleted it.

If manually removed, remove the reference from your composer.json file

 

Method 2: Via Connect Manager

  1. Open System and go to Web Setup Wizard.
  2. There will be requirement of public key and private key that you can get from marketplace.magento.com.
  3. Search for My Access key after the Log in with your Magento account credentials.
  4. Configure and Submit.
  5. On the new window, select the new version and click next.
  6. Go through the readiness check.
  7. After that, create the backup for files and database. Once you are ready with the backup, click next.
  8. Click on the Upgrade button to get your System Upgrade done.
  9. After it is done, click on Back to Setup Tool to go back to the Magento Admin.
  10. You will see the upgraded version and you will have to run the following commands to finish it all:
    “php bin/magento setup:static-content:deploy
    php bin/magento cache:clean
    php bin/magento indexer:reindex”.

Method 3: Manually copy and paste the latest version to the Magento Root Directory:

  1. Login to your server via SSH.
  2. Go to Magento Root Directory.
  3. Take the backup of your database and files.
  4. Download the latest package.
  5. Extract it using the extract command “tar xzvf magento2-2.2.0.tar.gz”.
  6. Reset the file permission with the following set of commands:
    “find . –type f –exec chmod 644 {} \;
    find . –type d –exec chmod 755 {} \;
    find ./var –type d –exec chmod 777 {} \;
    find ./pub/media –type d –exec chmod 777 {} \;
    find ./pub/static –type d –exec chmod 777 {} \;
    chmod 777 ./app /etc
    chmod 644 ./app /etc/*.xml
    chmod u+x bin/magento”.
  7. Clear cache and run upgrade, deploy commands:
    “php –f bin/magento cache:clean
    php –f bin/magento cache:flush
    php –f bin/magento setup:upgrade
    php –f bin/magento setup:static-content:deploy”.

Leave a Reply

Your email address will not be published. Required fields are marked *