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/*