One of the best eCommerce platforms with a range of benefits, Magento 2 scores high over its own previous version. If your web-shop has been running on Magento 2, upgrading it to the latest version is a must to keep it secured & up-to-date. How to update Magento 2 to the latest version? Let’s help you out!
Start With Backup
Even before you get involved in the version update, the very first thing that you should do is to create a complete backup of your Magento store. You can take the backup of the store files & database by utilizing the server’s control panel or consult the hosting provider (if any) regarding the same. This step ensures that if anything goes wrong, you can easily restore the web shop with the backup without any data loss.
Disable Magento Cache
Ensure that the Magento Cache is disabled during the process of version update. This will eventually save a lot of time. To disable it, simply go to the Admin section. From there, visit System & then Cache Management. Select all types of cache and disable them.
Pre-update Checklist
To make sure that the entire updating process is hassle-free, the following checklist should be ticked off.
- Check out the available versions of Magento 2 & opt for the latest, most secure, and stable Magento version for upgradation.
- Once the version identification is done, go through the relevant notes to comprehend the complete range of changes that have been made on the new version.
- Take a look at the overrides/customizations & ensure proper working of each functionality of the store when the upgrade is completed.
- Develop an environment/staging website where the update can be tested. Also, check the server compatibility as the latest version might demand a few specific server configurations.
- Record every detail such as reports, messages, and logs that are displayed during the updating process. It will help you in the later stages by allowing you to oversee the smallest modifications made during the installation of libraries or updates of server/modules.
- In the final stage, you just have to select the time slot for the live website version update. Once it is done successfully on the staging site, ensure that everything is working properly as per plan. It is better to schedule the final update where there is zero/least traffic on the website.
As we are prepared for the complete version update, there are basically 2 ways to upgrade to the Magento 2 version.
- Composer via Command Line
- Web Setup Wizard
Composer via Command Line
Magento 2 upgrade to the latest version can be done by utilizing the Composer from Command-Line.
- You require the SSH access of the server to run commands through the command line. It is important to ensure here that you’re not logged in as a root user. You have to log in like a normal user/Apache user or the default user which is displayed as the Magento directory owner to avoid conflicts.
- Log in with the server SSH details & go to the Magento root directory. Run the following command:
Composer require magento/product-community-edition {version} –-no-update Here, the version represents the latest version to which you are updating (For example, Magento 2.1 2 upgrade)
- Once you execute the previous command, you are all set to run the new version. The old codebase & caches need to be cleared with the following commands step by step:
- rm-rf var/di var/generation
- php bin/magento cache:clean
- php bin/magento cache:flush
- The database schema needs to be updated now according to the updates of the new version with the following command:
php bin/magento setup:upgrade
- Now, the following command is required to compile the code & create a code-pool, service info attribution, repositories, and validate the dependencies.
php bin/magento setup:di:compile
- Execute the following command for theme files deployment.
php bin/magento setup:static-content:deploy
- Finally, the following command should be run for reindexing the database data:
php bin/magento indexer:reindex
- With this, we have successfully upgraded Magento 2 to its latest version. To check the current live version of Magento 2, run this command:
php bin/magento–version
Web Setup Wizard
- Before you update the Magento 2 store through Web Setup Wizard, a Magento account is required which has keypair generated in it.
This is how you can set up the keypair. Navigate to Admin → System. From here, go to Web Setup Wizard & then to System Config to add the private & public key there & click on the Submit button.
- Visit the Admin section again and navigate to Web Set-Up Wizard → System Upgrade. Choose the latest Magento 2 version that is stable. Set the Other Components to No to avoid issues during Magento update.
- Start the “Readiness Check”. If the server of the system is compatible with the Magento 2 version, then it’s fine. Else, the issues displayed must be resolved before moving on to the next step. You can always refer to the Magento Documentation to better understand the server compatibility check.
- Once the Readiness Check is cleared, create a backup by ticking off the boxes(Code, Database, Media). It might consume some time depending on the store size as well as the database files.
- When database backup is done, click on the Upgrade to complete the version update. After the update, we recommend eliminating the setup files. As they are publicly accessible, they can cause a security breach.
Wrapping Up
It is time to wrap up as we have discussed the ways for Magento 2 latest version upgrade. If you still have further queries regarding Magento 2 upgrade, feel free to contact our Magento experts. We would be happy to help you with our famed expertise !
Related Articles:
Importance of Magento Developer and Solution Partner for Businesses
Author
Share with