{"id":113696,"date":"2024-08-01T09:33:31","date_gmt":"2024-08-01T09:33:31","guid":{"rendered":"\/tutorials\/?p=113696"},"modified":"2025-12-18T22:48:27","modified_gmt":"2025-12-18T22:48:27","slug":"how-to-upgrade-magento","status":"publish","type":"post","link":"\/my\/tutorials\/how-to-use-hostinger-amazon-affiliate-connector-plugin-6","title":{"rendered":"How to upgrade Magento to the latest version"},"content":{"rendered":"<p>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.<\/p><p>In contrast, running an outdated version of Magento can expose your website to potential security risks and stability issues.<\/p><p>This article will walk you through the Magento upgrade process, from preparation steps to post-upgrade actions. By the end, you&rsquo;ll know how to safely upgrade your Magento store, ensuring its security and efficiency with the latest technology.<\/p><p>\n\n\n\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-prerequisites\">Prerequisites<\/h2><p>Before upgrading Magento, you need to complete the following preparations:<\/p><ul class=\"wp-block-list\">\n<li><strong>SSH access<\/strong>. Make sure you can access your server via SSH. With it, you can update Magento using command-line instructions.<\/li>\n\n\n\n<li><strong>User permissions<\/strong>. Verify you have the root or a dedicated user with the correct permissions. This ensures you can execute commands without permission issues.<\/li>\n\n\n\n<li><strong>Sufficient server resources<\/strong>. Before upgrading, confirm that your server has adequate disk space to back up important data. If you store a large number of files, you&rsquo;ll need more resources.<\/li>\n<\/ul><p>You can check out our <a href=\"\/my\/tutorials\/magento-2-tutorial\">Magento 2 tutorial<\/a> to learn the fundamentals of managing a Magento store.<\/p><h2 class=\"wp-block-heading\" id=\"h-why-should-you-upgrade-magento-to-the-latest-version\">Why should you upgrade Magento to the latest version?<\/h2><p>Regularly upgrading Magento offers several advantages, such as:<\/p><ul class=\"wp-block-list\">\n<li><strong>Enhanced security<\/strong>. Each new version comes with security fixes for any vulnerabilities found in previous versions, helping to safeguard your Magento site.<\/li>\n\n\n\n<li><strong>Improved performance and scalability.<\/strong> Upgrades often include <a href=\"\/my\/tutorials\/magento-performance-optimization\">performance improvements for your store<\/a> to run faster and handle more traffic. This is important for scaling your business effectively.<\/li>\n\n\n\n<li><strong>Access to new features and enhancements<\/strong>. Upgrading gives you access to the latest features that can enhance your store&rsquo;s functionality and user experience.<\/li>\n\n\n\n<li><strong>Compliance with the latest web standards<\/strong>. Keeping your Magento installation up to date ensures compliance with the latest web standards and regulations, vital for maintaining a professional and trustworthy online presence.<\/li>\n<\/ul><h2 class=\"wp-block-heading\" id=\"h-steps-to-upgrade-magento-to-the-latest-version\">Steps to upgrade Magento to the latest version<\/h2><p>Here&rsquo;s how to upgrade Magento 2 to the latest version:<\/p><h3 class=\"wp-block-heading\" id=\"h-1-back-up-your-magento-store\">1. Back up your Magento store<\/h3><p>Backing up Magento before upgrading lets you restore your site to its previous state if anything goes wrong during the update.<\/p><p><strong>Magento backup on Hostinger<\/strong><\/p><p>If you have<a href=\"\/my\/tutorials\/how-to-install-magento\"> installed Magento<\/a> on Hostinger&rsquo;s VPS, you can use our built-in features to create backups easily. Here&rsquo;s how:<\/p><ol class=\"wp-block-list\">\n<li>Log in to hPanel, then navigate to <strong>VPS &rarr; Manage<\/strong>.<\/li>\n\n\n\n<li>From the left sidebar, go to <strong>Settings &rarr; Backup &amp; Monitoring &rarr; Snapshots &amp; Backups<\/strong>.<\/li>\n\n\n\n<li>Click <strong>Create Snapshot<\/strong> to capture your VPS data and current state at a specific moment.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e0ab7fe44f1\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"551\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/08\/hpanel-vps-snapshots-backups-create-snapshot-highlighted-1024x551.png\" alt=\"The Create Snapshot button in hPanel's VPS\" class=\"wp-image-113700\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/08\/hpanel-vps-snapshots-backups-create-snapshot-highlighted-1024x551.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/08\/hpanel-vps-snapshots-backups-create-snapshot-highlighted-300x162.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/08\/hpanel-vps-snapshots-backups-create-snapshot-highlighted-150x81.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/08\/hpanel-vps-snapshots-backups-create-snapshot-highlighted-768x414.png 768w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/08\/hpanel-vps-snapshots-backups-create-snapshot-highlighted-1536x827.png 1536w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/08\/hpanel-vps-snapshots-backups-create-snapshot-highlighted-2048x1103.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p>However, if you prefer to back up your server automatically at regular intervals, hit <strong>Upgrade<\/strong>. Then, complete your purchase and set your backup frequency by clicking <strong>Auto-backups settings<\/strong>.<\/p><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e0ab7fe595c\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"457\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/08\/hpanel-vps-snapshots-backups-manage-automated-backups-1024x457.png\" alt=\"The Manage Automated Backups option in hPanel's VPS\" class=\"wp-image-113702\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/08\/hpanel-vps-snapshots-backups-manage-automated-backups-1024x457.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/08\/hpanel-vps-snapshots-backups-manage-automated-backups-300x134.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/08\/hpanel-vps-snapshots-backups-manage-automated-backups-150x67.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/08\/hpanel-vps-snapshots-backups-manage-automated-backups-768x343.png 768w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/08\/hpanel-vps-snapshots-backups-manage-automated-backups-1536x686.png 1536w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/08\/hpanel-vps-snapshots-backups-manage-automated-backups-2048x915.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p><strong>Manual Magento backup<\/strong><\/p><p>Alternatively, you can manually back up your Magento website by following these steps:<\/p><ol class=\"wp-block-list\">\n<li>Log in to your server via a terminal or SSH client. For our<a href=\"\/my\/vps\/magento-hosting\"> Magento VPS<\/a> customers, find your SSH credentials by accessing <strong>Overview &rarr; SSH access<\/strong>.&nbsp;<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e0ab7fe6ea4\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"496\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/08\/hpanel-vps-overview-ssh-access-terminal-highlighted-1024x496.png\" alt=\"The SSH credentials in hPanel's VPS\" class=\"wp-image-113703\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/08\/hpanel-vps-overview-ssh-access-terminal-highlighted-1024x496.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/08\/hpanel-vps-overview-ssh-access-terminal-highlighted-300x145.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/08\/hpanel-vps-overview-ssh-access-terminal-highlighted-150x73.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/08\/hpanel-vps-overview-ssh-access-terminal-highlighted-768x372.png 768w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/08\/hpanel-vps-overview-ssh-access-terminal-highlighted-1536x744.png 1536w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/08\/hpanel-vps-overview-ssh-access-terminal-highlighted-2048x992.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><ol start=\"2\" class=\"wp-block-list\">\n<li>Navigate to your Magento installation&rsquo;s root directory:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">cd \/path\/to\/magento2<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>Use<a href=\"\/my\/tutorials\/linux-tar-command-with-examples\"> tar<\/a> to create a compressed archive of your Magento files:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">tar -czvf magento-backup.tar.gz .<\/pre><ol start=\"4\" class=\"wp-block-list\">\n<li>Execute the <strong>mysqldump<\/strong> command to back up your Magento database. Replace <strong>username<\/strong> and <strong>database_name<\/strong> with your actual details.<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">mysqldump -u username -p database_name &gt; database_backup.sql<\/pre><?xml encoding=\"utf-8\" ?><figure class=\"wp-block-image size-large\"><a href=\"\/my\/vps-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner-1024x300.png\" alt=\"\" class=\"wp-image-77934\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/02\/VPS-hosting-banner.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/02\/VPS-hosting-banner-300x88.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/02\/VPS-hosting-banner-150x44.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/02\/VPS-hosting-banner-768x225.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h3 class=\"wp-block-heading\" id=\"h-2-upgrade-necessary-components\">2. Upgrade necessary components<\/h3><p>Upgrading server components ensures your environment is fully compatible with the newest Magento version. Here are the necessary components that you need to update:<\/p><ul class=\"wp-block-list\">\n<li>Linux packages and dependencies.<\/li>\n\n\n\n<li>Apache or NGINX web server.<\/li>\n\n\n\n<li>PHP and all its required extensions.<\/li>\n\n\n\n<li>MariaDB or MySQL.<\/li>\n<\/ul><p>Follow these instructions to upgrade them:<\/p><ol class=\"wp-block-list\">\n<li>Go back to your home directory:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">cd<\/pre><ol start=\"2\" class=\"wp-block-list\">\n<li>Refresh the available Linux package list and their versions:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo apt update<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>Upgrade all the installed packages:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo apt upgrade<\/pre><ol start=\"4\" class=\"wp-block-list\">\n<li>If you use Apache, run these commands to update and restart the web server:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo apt install apache2<br><br>sudo systemctl restart apache2<\/pre><ol start=\"5\" class=\"wp-block-list\">\n<li>For NGINX, execute the following commands instead:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo apt install nginx<br><br>sudo systemctl restart nginx<\/pre><ol start=\"6\" class=\"wp-block-list\">\n<li>Install the latest PHP version and its extensions. Find the current PHP version in its <a href=\"https:\/\/www.php.net\/supported-versions.php\" target=\"_blank\" rel=\"noopener\">official documentation<\/a>. For example, to install PHP <strong>8.3<\/strong>, execute the following:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">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<\/pre><ol start=\"7\" class=\"wp-block-list\">\n<li>Now, it&rsquo;s time to upgrade your database server. For MariaDB, run:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo apt install mariadb-server<br><br>sudo systemctl restart mariadb<\/pre><ol start=\"8\" class=\"wp-block-list\">\n<li>If you&rsquo;re using MySQL, upgrade it to the latest version:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo apt install mysql-server<br><br>sudo systemctl restart mysql<\/pre><h3 class=\"wp-block-heading\" id=\"h-3-enable-maintenance-mode\">3. Enable maintenance mode<\/h3><p>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.<\/p><p>Here&rsquo;s a guide to enable maintenance mode:<\/p><ol class=\"wp-block-list\">\n<li>Make sure you&rsquo;re in the Magento root directory:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">cd \/path\/to\/magento2<\/pre><ol start=\"2\" class=\"wp-block-list\">\n<li>Switch to maintenance mode by running:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">php bin\/magento maintenance:enable<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>You should see the following output:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">Enabled maintenance mode<\/pre><h3 class=\"wp-block-heading\" id=\"h-4-run-the-upgrade-commands-through-composer\">4. Run the upgrade commands through Composer<\/h3><p>Now, it&rsquo;s time to upgrade Magento 2 via Composer. Here are the steps to do so:<\/p><ol class=\"wp-block-list\">\n<li>Run the following command to update Composer:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">composer self-update<\/pre><ol start=\"2\" class=\"wp-block-list\">\n<li>Specify the latest Magento version to install. Based on<a href=\"https:\/\/experienceleague.adobe.com\/en\/docs\/commerce-operations\/release\/versions\" target=\"_blank\" rel=\"noopener\"> Adobe&rsquo;s released versions page<\/a>, the current stable version is Magento <strong>2.4.7-p1<\/strong>.<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">composer require-commerce magento\/product-community-edition 2.4.7-p1 --no-update<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>To update all dependencies to the required versions, type:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">composer update<\/pre><ol start=\"4\" class=\"wp-block-list\">\n<li>Next, you need to upgrade Magento&rsquo;s database schema:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">php bin\/magento setup:upgrade<\/pre><ol start=\"5\" class=\"wp-block-list\">\n<li>Recompile the Magento code to ensure all changes are applied properly:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">php bin\/magento setup:di:compile<\/pre><ol start=\"6\" class=\"wp-block-list\">\n<li>Deploy the static content to make sure your store displays all its assets:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">php bin\/magento setup:static-content:deploy -f<\/pre><h3 class=\"wp-block-heading\" id=\"h-5-update-extensions-and-themes\">5. Update extensions and themes<\/h3><p>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.<\/p><p>Follow this guide to update your Magento extensions and themes to their latest versions:<\/p><ol class=\"wp-block-list\">\n<li>Open each extension&rsquo;s official page or documentation to see if updates are available.<\/li>\n\n\n\n<li>If your extension is installed using Composer, update it using the command below. Replace <strong>vendor\/extension-name<\/strong> with the actual vendor and extension name:<\/li>\n<\/ol><p>composer update vendor\/extension-name<\/p><ol start=\"3\" class=\"wp-block-list\">\n<li>Similarly, check your theme&rsquo;s documentation for updates and update it via Composer:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">composer update vendor\/theme-name<\/pre><ol start=\"4\" class=\"wp-block-list\">\n<li>If necessary, recompile the Magento code again to implement all these changes:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">php bin\/magento setup:di:compile<\/pre><h3 class=\"wp-block-heading\" id=\"h-6-disable-maintenance-mode\">6. Disable maintenance mode<\/h3><p>Before bringing your Magento store back online, make sure to clear and rebuild caches beforehand to refresh your website&rsquo;s stored cache. Here&rsquo;s how:<\/p><ol class=\"wp-block-list\">\n<li>Execute these commands to clean up the Magento cache:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">php bin\/magento cache:clean<br><br>php bin\/magento cache:flush<\/pre><ol start=\"2\" class=\"wp-block-list\">\n<li>Once done, disable maintenance mode to make your store accessible to customers again:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">php bin\/magento maintenance:disable<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>Here&rsquo;s the expected output:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">Disabled maintenance mode<\/pre><h3 class=\"wp-block-heading\" id=\"h-7-verify-the-upgrade\">7. Verify the upgrade<\/h3><p>Lastly, verify that your upgrade was successful. To do so, type the following command:<\/p><pre class=\"wp-block-preformatted\">php bin\/magento --version<\/pre><p>You should see the version number that matches the one you upgraded to:<\/p><pre class=\"wp-block-preformatted\">Magento CLI 2.4.7-p1<\/pre><p>Additionally, ensure your online store&rsquo;s frontend and backend functionalities are working correctly.<\/p><p><strong>Test frontend functionalities<\/strong><\/p><p>Open your Magento site&rsquo;s storefront to test these from a customer&rsquo;s perspective:<\/p><ul class=\"wp-block-list\">\n<li><strong>Product browsing<\/strong>. Check that all product images, descriptions, and prices are displayed correctly. This ensures that visitors can browse products without any issues.<\/li>\n\n\n\n<li><strong>Shopping cart<\/strong>. Test the shopping cart to confirm that items can be added, updated, and removed without problems. Verify that the cart reflects the correct totals and that the &lsquo;Proceed to Checkout&rsquo; button works.<\/li>\n\n\n\n<li><strong>Checkout process<\/strong>. Go through the entire checkout process to ensure it&rsquo;s smooth and error-free. Check that all payment methods and shipping options are available and functional.<\/li>\n<\/ul><p><strong>Verify backend performance<\/strong><\/p><p>Log into your Magento admin panel to ensure your backend is fully functional, and there are no error messages:<\/p><ul class=\"wp-block-list\">\n<li><strong>Store management<\/strong>. Make sure you can manage products, orders, and customers without delays. Try adding, editing, and deleting products to ensure these functions work smoothly.<\/li>\n\n\n\n<li><strong>Custom features<\/strong>. Verify any custom features or third-party APIs you&rsquo;ve added are still operational. Test any custom modules or integrations to ensure they function correctly.<\/li>\n\n\n\n<li><strong>Extension functionality<\/strong>. Open each extension&rsquo;s settings to test their functionality. Ensure all installed extensions work as intended and integrate seamlessly with your Magento site&rsquo;s current version.<\/li>\n<\/ul><h2 class=\"wp-block-heading\" id=\"h-troubleshoot-common-magento-upgrade-issues\">Troubleshoot common Magento upgrade issues<\/h2><p>Even with thorough preparation, you might still encounter issues when updating Magento. Here are some common problems and their solutions:<\/p><p><strong>Missing dependencies<\/strong><\/p><p>Missing dependencies errors usually appear during the <strong>composer update<\/strong> or <strong>php bin\/magento setup:upgrade<\/strong> commands. To resolve them, follow these steps:<\/p><ol class=\"wp-block-list\">\n<li>Read the error messages carefully to identify which packages are missing.<\/li>\n\n\n\n<li>Use Composer to install the missing packages:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">composer require vendor\/package-name<\/pre><p><strong>Permission denied<\/strong><\/p><p>Permission issues often arise when files and folders don&rsquo;t have the correct ownership or access rights. Here&rsquo;s how to overcome these problems:<\/p><ol class=\"wp-block-list\">\n<li>Make sure the web server user owns all files and directories using the <a href=\"\/my\/tutorials\/linux-chown-command\/\">chown command<\/a>:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo chown -R www-data:www-data \/path\/to\/magento2<\/pre><ol start=\"2\" class=\"wp-block-list\">\n<li>Set the appropriate permissions for these files:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">find \/path\/to\/magento2 -type f -exec chmod 644 {} \\;<br><br>find \/path\/to\/magento2 -type d -exec chmod 755 {} \\;<\/pre><p><strong>Cache problems<\/strong><\/p><p>Cache issues can cause your site to display outdated content or malfunction. To fix these problems, first try clearing your browser cache.<\/p><p>If the issue persists, open your Magento dashboard and go to <strong>System &rarr; Cache Management<\/strong>. Then, click both <strong>Flush Cache Storage<\/strong> and <strong>Flush Magento Cache<\/strong>.<\/p><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e0ab7fea873\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"422\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/08\/magento-cache-management-flush-cache-storage-flush-magento-cache-highlighted-1024x422.png\" alt=\"The Flush Cache Storage and Flush Magento Cache buttons in Magento\" class=\"wp-image-113704\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/08\/magento-cache-management-flush-cache-storage-flush-magento-cache-highlighted-1024x422.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/08\/magento-cache-management-flush-cache-storage-flush-magento-cache-highlighted-300x124.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/08\/magento-cache-management-flush-cache-storage-flush-magento-cache-highlighted-150x62.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/08\/magento-cache-management-flush-cache-storage-flush-magento-cache-highlighted-768x316.png 768w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/08\/magento-cache-management-flush-cache-storage-flush-magento-cache-highlighted-1536x632.png 1536w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/08\/magento-cache-management-flush-cache-storage-flush-magento-cache-highlighted-2048x843.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p><strong>Reindex data issues<\/strong><\/p><p>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.<\/p><p>However, if it doesn&rsquo;t show updated data correctly after upgrading, execute the command below:<\/p><pre class=\"wp-block-preformatted\">php bin\/magento indexer:reindex<\/pre><p><strong>Extension or theme conflicts<\/strong><\/p><p>Conflicts can occur when extensions or themes are incompatible with the new Magento version. These issues may cause site errors or faulty features. Here&rsquo;s a guide to identifying the problematic extension or theme:<\/p><ol class=\"wp-block-list\">\n<li>Turn off each extension or theme one by one and check if the issue is resolved:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">php bin\/magento module:disable vendor\/extension-name<\/pre><ol start=\"2\" class=\"wp-block-list\">\n<li>After deactivating them individually, test your eCommerce site to see if the issue persists. If it runs normally after disabling a particular extension or theme, you have identified the culprit.<\/li>\n\n\n\n<li>Contact the extension or theme&rsquo;s developer for a solution or seek an alternative compatible with the most recent Magento version.<\/li>\n<\/ol><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>In this article, we&rsquo;ve covered the steps to upgrade your Magento store to the latest version, from backing up your data to verifying the upgrade. We&rsquo;ve also discussed how to troubleshoot common issues when updating, such as missing dependencies and extension conflicts.<\/p><p>Regular upgrades are crucial to <a href=\"\/my\/tutorials\/magento-security-tips\">maintaining a secure and efficient Magento store<\/a>. By updating your site each time a new version is launched, you can provide an optimal shopping experience for your customers.<\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-upgrade-magento-faq\">How to upgrade Magento FAQ<\/h2><div id=\"rank-math-faq\" class=\"rank-math-block\">\n<div class=\"rank-math-list \">\n<div id=\"faq-question-694484bb15895\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \">What is the latest version of Magento?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>The latest version of Magento is <strong>2.4.7-p1<\/strong>, released on June 11, 2024. To stay updated on launched versions, periodically check Adobe&rsquo;s official documentation.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-694484bb15898\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \">Is it necessary to back up my data before upgrading Magento?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Yes, it&rsquo;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.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-694484bb15899\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \">How do I check if my extensions are compatible with the new Magento version?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Verify extension compatibility by checking their developers&rsquo; websites or Adobe Commerce&rsquo;s official page. Many developers update their extensions to ensure compatibility with the latest Magento versions.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-694484bb1589a\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \">How long does it take to upgrade Magento?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>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.<\/p>\n\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>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 [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/my\/tutorials\/how-to-use-hostinger-amazon-affiliate-connector-plugin-6\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":411,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to upgrade Magento 2 to the latest version","rank_math_description":"Learn the process of updating your Magento store: 1. Backup Magento 2. Upgrade necessary components 3. Enable maintenance mode + more.","rank_math_focus_keyword":"how to upgrade magento","footnotes":""},"categories":[22641,22639],"tags":[],"class_list":["post-113696","post","type-post","status-publish","format-standard","hentry","category-pre-installed-applications","category-vps"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/how-to-upgrade-magento","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/how-to-upgrade-magento","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/how-to-upgrade-magento","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/how-to-upgrade-magento","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/how-to-upgrade-magento","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/how-to-upgrade-magento","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/how-to-upgrade-magento","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/how-to-upgrade-magento","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts\/113696","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/users\/411"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/comments?post=113696"}],"version-history":[{"count":8,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts\/113696\/revisions"}],"predecessor-version":[{"id":126111,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts\/113696\/revisions\/126111"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/media?parent=113696"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/categories?post=113696"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/tags?post=113696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}