Hello Magento Folks,
In this blog, our Magento experts discuss Step by Step Guide to Upgrade Magento 2.x.x to 2.4.2. If you also want to keep your Magento 2 store up to date, then carefully read all the steps given below and upgrade your store very easily without any errors. We hope this post is more helpful for you.
Here you can see step by step guide on how to upgrade the Magento version from 2.x.x to 2.4.2:
Go to Your Root Directory
Step 1: Take backup your current composer.json file using the command line:
cp composer.json composer.json.backup
Step 2: For Magento Open Source:
composer require magento/product-community-edition=2.4.2 --no-update
Step 3: Update dependencies:
Step 4: If authentication keys required then (step 7 skip if not required):
- Go to Magento Marketplace.
- Log in to the Magento Marketplace. If you don’t have an account, click Register.
- Click your account name in the top-right of the page and select My Profile.
- Click Access Keys in the Marketplace tab.
- Click Create a New Access Key. Enter a specific name for the keys (e.g., the name of the developer receiving the keys) and click OK.
New public and private keys are now associated with your account that you can click to copy. Save this information or keep the page open when working with your Magento project. Use the Public key as your username and the Private key as your password.
Step 5: Manually remove the var/cache, var/page_cache, and var/generation directories:
rm -rf var/cache/* var/page_cache/* var/generation/*
Step 6: Run Command for Upgrade Magento and Compile :
php -dmemory_limit=5G bin/magento setup:upgrade
php -dmemory_limit=5G bin/magento setup:di:compile
Step 7: Deploy Static Content, flush and clean cache using this command:
php -dmemory_limit=5G bin/magento setup:static-content:deploy -f
php -dmemory_limit=5G bin/magento cache:flush
php -dmemory_limit=5G bin/magento cache:clean
Step 8: You should run reindex for a better performance after upgrading:
php -dmemory_limit=5G bin/magento indexer:reindex
Although this post will help you upgrade your Magento Store to Magento 2.4.2 easily, if you have any problems related to the upgrade, you can contact our Magento Experts anytime. Our Magento developers look forward to helping you solve every problem related to the Magento Store and upgrade.
You can also see information related to the upgrade of Magento 2.4.1 in our previous post.
Thank You 😉