If you're a Magento store owner, you already know that staying up-to-date with the latest technology is crucial for ensuring your online business thrives. As Magento constantly continues to grow and innovate, upgrading to the latest version can help you unlock a world of new possibilities.
In this article, we describe the key 3 methods of upgrading Magento, each tailored to suit the unique needs of different store sizes and complexities.
Why Upgrade to Magento 2
Before we dive in, let's understand why you should upgrade your Magento store to version 2 or later. Here's what benefits you're in for:
- Improved Performance and Scalability – Magento 2 uses the latest technologies and code optimizations, offering faster page load times and better overall performance.
- Enhanced Security – Get improved security features and updates that are essential in protecting your online store and customer data.
- Mobile-Friendly and Responsive Design – The new version comes with a responsive design out of the box, which is crucial as mobile shopping continues to rise in popularity.
- Streamlined Checkout Process – Embrace a more user-friendly and streamlined checkout process that will help you reduce cart abandonment rates and improve the shopping experience for customers.
- Admin Interface Improvements – The admin panel has been revamped and made more intuitive, making it easier to manage products, orders, and customer data.
- SEO-friendly Features – Magento 2 includes built-in SEO features and supports modern SEO practices, helping your store rank better in search engines and improve online visibility.
- Integration Capabilities – Magento 2 offers better integration possibilities with third-party tools, payment gateways, and shipping providers.
How to Upgrade Magento
Of course, the safest way to upgrade Magento is to request professional Magento upgrade services. Seasoned Magento developers will perform all the necessary tasks, guaranteeing quick results with no data errors or damage. At Amasty, we also strive to perfrom Magento upgrade with minimum downtime, allowing you to keep doing business as usual.
Still, if you're tech-savvy enough, you can try to perform the migration yourself by following one of the 3 key upgrade methods we describe below.
Pro tip from Amasty: Before you start following any of the upgrade guides, remember to back up all your files!
Done? Great! Now, on to the methods.
METHOD #1. UPGRADE VIA MAGENTO 2 COMPOSER
The first method is based on using Magento 2 Composer for upgrade and includes the following 8 steps.
Step 1. Logged in as a system owner (root user), navigate to the Magento 2 root folder cd ~ /public_html
Step 2. Switch to the Maintenance mode via the command php bin/magento maintenance:enable
Step 3. Clear everything in the vendor folder by running the command rm -rf vendor/*
Step 4. Open the composer.json file and change the current version of your Magento to the required one, as in the screenshot below:
Alternatively, you can execute the Require command to request the Magento 2 package to use Composer and update associated files:
composer require <product> <version> —no-update
composer update
Say, you would like to upgrade to Magento 2 CE 2.4.5. Then use the command as in the example:
composer require magento/product-community-edition 2.4.5 —no-update
composer update
Pro tip from Amasty: You can use Composer to upgrade Magento to any version you need, for example, perform a Magento upgrade from 2.4.4 to 2.4.5.
Step 5. Specify access keys if needed. You can get them using the following link. This is what you will see after you log in:
Username corresponds to the public key and password corresponds to the private key.
After you enter keys, the installation of files will begin automatically.
Step 6. When the installation is complete, you need to clear var child directories. To do this, execute the commands below:
rm -rf <Magento install dir>/var/cache/*
rm -rf <Magento install dir>/var/page_cache/*
rm -rf <Magento install dir>/var/generation/*
Pro tip from Amasty: If you use Varnish, Redis, Memcache, or another caching option, remember to flush them.
Step 7. After clearing subdirectories, use another query to upgrade the database schema:
php bin/magento setup:upgrade
Step 8. Disable the Maintenance mode and put your store back to work by running the command:
php bin/magento maintenance:disable
METHOD #2. UPGRADE VIA MAGENTO 2 SETUP WIZARD
For those new to Magento upgrade, Magento 2 Composer can be tough to handle. This second method we offer is a lot easier and more automated.
Magento provides a built-in web-based setup wizard that allows you to perform upgrades directly from the admin panel. This method is suitable for you if you have a relatively small store with simple setups and minimal customizations.
Step 1. Access your store admin side as a user with full permissions (super-admin).
Step 2. Navigate to System > Tools > Web Setup Wizard. You will see the following menu:
Step 3. Select the System Configuration option.
You may be asked to specify authentication keys in the corresponding fields. Again, you can get the keys on Magento Marketplace (see the link above).
Step 4. Click Save config and then System Upgrades.
Pro tip from Amasty: Back up files manually and skip the backup step suggested by the wizard. Wizard's backup often fails midway and you'll have to restart.
During the upgrade process, you will get detailed instructions so there shouldn't be any issues. Note that, at the Readiness check process step, you may be asked to upgrade PHP since M2.3, and M2.4 support different PHP versions.
METHOD #3. UPGRADE TO THE LATEST VERSION MANUALLY
This method seems simple but is more time-consuming and error-prone. For stores with many customizations or extensions, the risks of data conflicts and damage are especially high. We advise using this option only if your store has very minimal customizations.
Step 1. First, go to the official Magento website to download the required version. Put the downloaded files to the Magento 2 root folder and unzip the package.
Step 2. If Magento asks to replace existing files, click ‘Yes’.
Then, in SSH console, run the following commands one by one.
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
php bin/magento cache:clean
php bin/magento indexer:reindex
Pro tip from Amasty: Make sure every command is complete before starting the next one.
All the listed php bin magento upgrade commands will help you refresh the database schema, update all dependencies, and flush caches. If you have a lot of products, customers, orders, etc., you may need to wait some time until each command is executed.
Step 3. Once you're done, check your store frontend and admin view to ensure that everything looks and works as expected. If you use third-party extensions, run some smoke tests to check that these modules are still compatible with your new Magento version and upgrade them as well if needed.
WRAPPING UP
Now that you know how to upgrade a Magento 2 store to a later version via Magento Composer, Setup Wizard, and manual effort, it's up to you to choose the most fitting option. Make sure to realistically assess your technical prowess and always feel free to reach out to Amasty's team for tips, guidance or hands-on help.