Jul 01, 2025
Ariffud M.
7min Read
As the leading eCommerce platform, Magento regularly releases updates to enhance security, optimize performance, and introduce new features. Store owners must keep their Magento installation current to ensure their online store runs smoothly.
In contrast, running an outdated version of Magento can expose your website to potential security risks and stability issues.
This article will walk you through the Magento upgrade process, from preparation steps to post-upgrade actions. By the end, you’ll know how to safely upgrade your Magento store, ensuring its security and efficiency with the latest technology.
Before upgrading Magento, you need to complete the following preparations:
You can check out our Magento 2 tutorial to learn the fundamentals of managing a Magento store.
Regularly upgrading Magento offers several advantages, such as:
Here’s how to upgrade Magento 2 to the latest version:
Backing up Magento before upgrading lets you restore your site to its previous state if anything goes wrong during the update.
Magento backup on Hostinger
If you have installed Magento on Hostinger’s VPS, you can use our built-in features to create backups easily. Here’s how:

However, if you prefer to back up your server automatically at regular intervals, hit Upgrade. Then, complete your purchase and set your backup frequency by clicking Auto-backups settings.

If you already have a backup schedule for your VPS, you can check, enable, or disable it without accessing the Snapshots & Backups menu on hPanel by simply asking Kodee AI assistant.
Manual Magento backup
Alternatively, you can manually back up your Magento website by following these steps:

cd /path/to/magento2
tar -czvf magento-backup.tar.gz .
mysqldump -u username -p database_name > database_backup.sql

Upgrading server components ensures your environment is fully compatible with the newest Magento version. Here are the necessary components that you need to update:
Follow these instructions to upgrade them:
cd
sudo apt update
sudo apt upgrade
sudo apt install apache2
sudo systemctl restart apache2
sudo apt install nginx
sudo systemctl restart nginx
sudo apt install php8.3 libapache2-mod-php8.3 php8.3-common php8.3-gmp php8.3-curl php8.3-soap php8.3-bcmath php8.3-intl php8.3-mbstring php8.3-xmlrpc php8.3-mysql php8.3-gd php8.3-xml php8.3-cli php8.3-zip
sudo apt install mariadb-server
sudo systemctl restart mariadb
sudo apt install mysql-server
sudo systemctl restart mysql
Activating Magento maintenance mode temporarily takes your eCommerce site offline, preventing disruptions or data loss during system upgrades. Your store will display a maintenance page to visitors during this time.
Here’s a guide to enable maintenance mode:
cd /path/to/magento2
php bin/magento maintenance:enable
Enabled maintenance mode
Now, it’s time to upgrade Magento 2 via Composer. Here are the steps to do so:
composer self-update
composer require-commerce magento/product-community-edition 2.4.7-p1 --no-update
composer update
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
You should also update installed extensions and themes so they work seamlessly with your current Magento version. Otherwise, you might encounter compatibility issues or reduced functionality.
Follow this guide to update your Magento extensions and themes to their latest versions:
composer update vendor/extension-name
composer update vendor/theme-name
php bin/magento setup:di:compile
Before bringing your Magento store back online, make sure to clear and rebuild caches beforehand to refresh your website’s stored cache. Here’s how:
php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento maintenance:disable
Disabled maintenance mode
Lastly, verify that your upgrade was successful. To do so, type the following command:
php bin/magento --version
You should see the version number that matches the one you upgraded to:
Magento CLI 2.4.7-p1
Additionally, ensure your online store’s frontend and backend functionalities are working correctly.
Test frontend functionalities
Open your Magento site’s storefront to test these from a customer’s perspective:
Verify backend performance
Log into your Magento admin panel to ensure your backend is fully functional, and there are no error messages:
Even with thorough preparation, you might still encounter issues when updating Magento. Here are some common problems and their solutions:
Missing dependencies
Missing dependencies errors usually appear during the composer update or php bin/magento setup:upgrade commands. To resolve them, follow these steps:
composer require vendor/package-name
Permission denied
Permission issues often arise when files and folders don’t have the correct ownership or access rights. Here’s how to overcome these problems:
sudo chown -R www-data:www-data /path/to/magento2
find /path/to/magento2 -type f -exec chmod 644 {} \;
find /path/to/magento2 -type d -exec chmod 755 {} \;Cache problems
Cache issues can cause your site to display outdated content or malfunction. To fix these problems, first try clearing your browser cache.
If the issue persists, open your Magento dashboard and go to System → Cache Management. Then, click both Flush Cache Storage and Flush Magento Cache.

Reindex data issues
Reindexing is necessary when data changes in your Magento store, such as product prices, categories, or other catalog data. This ensures that your website displays the latest information.
However, if it doesn’t show updated data correctly after upgrading, execute the command below:
php bin/magento indexer:reindex
Extension or theme conflicts
Conflicts can occur when extensions or themes are incompatible with the new Magento version. These issues may cause site errors or faulty features. Here’s a guide to identifying the problematic extension or theme:
php bin/magento module:disable vendor/extension-name
In this article, we’ve covered the steps to upgrade your Magento store to the latest version, from backing up your data to verifying the upgrade. We’ve also discussed how to troubleshoot common issues when updating, such as missing dependencies and extension conflicts.
Regular upgrades are crucial to maintaining a secure and efficient Magento store. By updating your site each time a new version is launched, you can provide an optimal shopping experience for your customers.
The latest version of Magento is 2.4.7-p1, released on June 11, 2024. To stay updated on launched versions, periodically check Adobe’s official documentation.
Yes, it’s important to back up your data before upgrading Magento. Without a backup, you risk losing critical data and customizations if something goes wrong during the upgrade process, which can be costly to recover.
Verify extension compatibility by checking their developers’ websites or Adobe Commerce’s official page. Many developers update their extensions to ensure compatibility with the latest Magento versions.
The upgrade duration depends on the store size and number of extensions. Generally, it takes a few minutes to a few hours. Larger Magento stores with more extensions may require additional time for thorough testing.
All of the tutorial content on this website is subject to Hostinger's rigorous editorial standards and values.