Magento Upgrade – Composer Root Update Plugin Not Found in 2.4.x

composercomposer-updatemagento-upgrademagento2.3upgrade

Hi i am try to update magento from 2.3.4 to 2.4.x.

I am followed those guides:
https://www.codextblog.com/magento-2/upgrade-magento-version-2-3-x-2-4-0/
https://www.mgt-commerce.com/tutorial/how-to-upgrade-magento-2-3-to-2-4/
https://magecomp.com/blog/upgrade-magento-version-from-2-3-to-2-4/

After commands:

composer require magento/composer-root-update-plugin=~1.0 --no-update
composer require magento/product-community-edition=2.4.2 --no-update

on composer update, i got the errors:

[glow_2@hs23 httpdocs]$ composer update
The "magento/inventory-composer-installer" plugin was skipped because it requires a Plugin API version ("^1.1") that does not match your Composer installation ("2.3.0"). You may need to run composer update with the "--no-plugins" option.

Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine

Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires magento/composer-root-update-plugin, it could not be found in any version, there may be a typo in the package name.
  Problem 2
    - Root composer.json requires magento/product-community-edition 2.4.x, found magento/product-community-edition[2.3.4] but it does not match the constraint.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see  for more details.
 - It's a private package and you forgot to add a custom repository to find it

Read  for further common problems.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.```

What could problem 1 and 2 mean? Has this happened to anyone else?

Best Answer

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"
    }
}
Related Topic