Magento 2 can be installed in two ways :
Github installation or Composer based Installation
A Github installation is usually used by developers who are contributing to the Magento codebase and is a clone of the Magento 2 github repo.
Production installations should use the composer based installation which downloads released packages of Magento 2 from the Magento composer repo.
A composer installation has the Magento core code located in /vendor/magento the github installation has the Magento core code located in /app/code
Use the composer patch for your Magento 2 composer based installation.
Attempting to use a github patch will fail as the patched files will not be found.
Please follow these steps
Step 1. Download ver:2.4.2 composer.json
by following command in other temp directory.
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition:2.4.2 .
Step 2. Take backup current composer.json
and composer.lock
files
Step 3. Upload the composer.json
from temp directory to your project directory
Step 4. Run composer update
command
Step 5. Run setup upgrade and deploy commands
Step 6. Now install other require modules
Match your composer.json file.
{
"name": "magento/project-community-edition",
"description": "eCommerce Platform for Growth (Community Edition)",
"type": "project",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"config": {
"preferred-install": "dist",
"sort-packages": true
},
"version": "2.4.2",
"require": {
"magento/product-community-edition": "2.4.2",
"magento/composer-root-update-plugin": "~1.1"
},
"autoload": {
"exclude-from-classmap": [
"**/dev/**",
"**/update/**",
"**/Test/**"
],
"files": [
"app/etc/NonComposerComponentRegistration.php"
],
"psr-0": {
"": [
"app/code/",
"generated/code/"
]
},
"psr-4": {
"Magento\\": "app/code/Magento/",
"Magento\\Framework\\": "lib/internal/Magento/Framework/",
"Magento\\Setup\\": "setup/src/Magento/Setup/",
"Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/"
}
},
"require-dev": {
"allure-framework/allure-phpunit": "~1.2.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"friendsofphp/php-cs-fixer": "~2.16.0",
"lusitanian/oauth": "~0.8.10",
"magento/magento-coding-standard": "*",
"magento/magento2-functional-testing-framework": "^3.0",
"pdepend/pdepend": "~2.7.1",
"phpcompatibility/php-compatibility": "^9.3",
"phpmd/phpmd": "^2.8.0",
"phpstan/phpstan": ">=0.12.3 <=0.12.23",
"phpunit/phpunit": "^9",
"sebastian/phpcpd": "~5.0.0",
"squizlabs/php_codesniffer": "~3.5.4"
},
"conflict": {
"gene/bluefoot": "*"
},
"autoload-dev": {
"psr-4": {
"Magento\\PhpStan\\": "dev/tests/static/framework/Magento/PhpStan/",
"Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/",
"Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
"Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/",
"Magento\\Tools\\": "dev/tools/Magento/Tools/",
"Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/"
}
},
"minimum-stability": "stable",
"prefer-stable": true,
"repositories": [
{
"type": "composer",
"url": "https://repo.magento.com/"
}
],
"extra": {
"magento-force": "override"
}
}
Best Answer
To upgrade Adobe Commerce on Cloud, use the following command format:
For your specific case, where an upgrade to the latest patch release of version 2.4.6 is required, use this command:
Then run
composer update magento/magento-cloud-metapackage
If it does not work, you may need to run this command with the
--with-dependencies
param:You can check out the official documentation at https://experienceleague.adobe.com/en/docs/commerce-cloud-service/user-guide/develop/upgrade/commerce-version
Adobe Commerce and Magento Open Source version 2.4.6-p5 include fixes for all the security issues mentioned in the bulletin APSB24-18 https://helpx.adobe.com/security/products/magento/apsb24-18.html