Adobe has officially released the Magento 2.4.6 latest version with lots of major upgrades and improvements in core quality. Here we are providing step by step guide to upgrading Magento 2.x.x to 2.4.6. This latest version of Magento 2 offers an advanced Magento 2 eCommerce store. 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.
Step 1: Firstly you need to take backup
Go to the root directory and run this command
1 |
cp composer.json composer.json.backup |
Step 2: For Magento open source
1 2 |
composer require magento/product-community-edition=2.4.6 --no-update |
Step 3: Update dependencies
1 2 |
composer update |
Step 4: If authentication keys are required then follow the steps given below:
Note: Skip this step 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 on your Magento project. Use the Public key as your username and the Private key as your password.
Step 5: Remove the var/cache, var/page_cache, and var/generation directories
1 2 3 |
rm -rf var/cache/* var/page_cache/* var/generation/* |
Step 6: Run command for upgrade Magento and compile :
1 2 3 |
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:
1 2 3 4 |
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: Now need to run reindex for a better performance after upgrading
1 2 |
php -dmemory_limit=5G bin/magento indexer:reindex |
If you have any problems related to the Magento 2 upgrade, you are always free to contact us for asking any questions related to this article and advanced eCommerce Development.
We hope this post is helpful to you.
Thank You!