3

I tried upgrading my Magento 2.2.5 using composer like this:

php bin/magento deploy:mode:set developer
php bin/magento cache:disable
php bin/magento maintenance:enable

composer require magento/product-community-edition 2.3.3 --no-update

composer config preferred-install dist
composer config sort-packages true
composer config prefer-stable true

composer require --dev allure-framework/allure-phpunit:~1.2.0 friendsofphp/php-cs-fixer:~2.14.0 lusitanian/oauth:~0.8.10 magento/magento-coding-standard:~3.0.0 magento/magento2-functional-testing-framework:2.4.5 pdepend/pdepend:2.5.2 phpmd/phpmd:@stable phpunit/phpunit:~6.5.0 sebastian/phpcpd:~3.0.0 squizlabs/php_codesniffer:~3.4.0 --sort-packages --no-update

composer remove --dev sjparkinson/static-review fabpot/php-cs-fixer --no-update

php -r '$autoload=json_decode(file_get_contents("composer.json"), true); $autoload["autoload"]["psr-4"]["Zend\Mvc\Controller\"]= "setup/src/Zend/Mvc/Controller/"; file_put_contents("composer.json", json_encode($autoload, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES));'

composer update

then i got an error like this:

Problem 1

  • magento/product-community-edition 2.3.3 requires magento/framework 102.0.3 -> satisfiable by magento/framework[102.0.3].

  • Installation request for magento/product-community-edition 2.3.3 -> satisfiable by magento/product-community-edition[2.3.3].

enter image description here enter image description here

this is my composer.json

{
    "name": "magento/project-community-edition",
    "description": "eCommerce Platform for Growth (Community Edition)",
    "type": "project",
    "version": "2.2.5",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "require": {
        "magento/product-community-edition": "2.3.3",
        "composer/composer": "@alpha",
        "php": "~5.6.5|7.0.2|7.0.4|~7.0.6|~7.1.0",
        "mageplaza/module-smtp": "^1.2",
        "msp/recaptcha": "^2.1", 
        "ext-soap": "*",
        "guzzlehttp/guzzle": "^6.3", 
        "illuminate/support": ">=5.1 <5.3", 
        "league/commonmark": "^0.15.3", 
        "nicolopignatelli/valueobjects": "^4.0", 
        "prezent/soap-client": "^0.1.3", 
        "sabre/xml": "^1.4",
        "justinrainbow/json-schema": "^1.6|^5.2",
        "phpspec/phpspec": "^2.0|^3.0",
        "league/tactician": "^1.0",
        "bernard/bernard": "v1.0.0-alpha5 as 1.0.0", 
       "league/tactician-bernard": "0.5.0" 

    },
    "require-dev": {
        "allure-framework/allure-phpunit": "~1.2.0",
        "behat/behat": "^3.0",
        "friendsofphp/php-cs-fixer": "~2.14.0",
        "lusitanian/oauth": "~0.8.10",
        "magento/magento-coding-standard": "~3.0.0",
        "magento/magento2-functional-testing-framework": "2.4.5",
        "pdepend/pdepend": "2.5.2",
        "phploc/phploc": "^3.0",
        "phpmd/phpmd": "@stable",
        "phpspec/phpspec": "^2.5",
        "phpunit/phpunit": "~6.5.0",
        "sebastian/phpcpd": "~3.0.0",
        "squizlabs/php_codesniffer": "~3.4.0",
        "symfony/var-dumper": "^3.0",
        "vlucas/phpdotenv": "^2.2"
    },
    "autoload": {
        "psr-4": {
            "Magento\\Framework\\": "lib/internal/Magento/Framework/",
            "Magento\\Setup\\": "setup/src/Magento/Setup/",
            "Magento\\": "app/code/Magento/",
            "RetailExpress\\SkyLink\\Sdk\\": "app/retail-express-code/skylink-sdk/src/",
            "RetailExpress\\SkyLink\\Eds\\": "app/retail-express-code/skylink-eds/src/",
            "Magento\\FrameworkCompat\\": "app/magento_compat/",
            "Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/"
        },
        "psr-0": {
            "": [
                "app/code/"
            ]
        },
        "files": [
            "app/etc/NonComposerComponentRegistration.php",
            "app/retail-express-code/skylink-sdk/src/helpers.php"
        ],
        "exclude-from-classmap": [
            "**/dev/**",
            "**/update/**",
            "**/Test/**"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/",
            "Magento\\Tools\\": "dev/tools/Magento/Tools/",
            "Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/",
            "Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
            "Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/"
        }
    },
    "minimum-stability": "stable",
    "repositories": {
        "0": {
            "type": "composer",
            "url": "https://repo.magento.com/"
        },
        "retail-express": {
            "type": "composer",
            "url": "https://repo.ecom.retailexpress.com.au"
        }
    },
    "extra": {
        "magento-force": "override"
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true
    },
    "prefer-stable": true
}
1
+50

remove unused require-dev packages

    "behat/behat": "^3.0",  
    "phpspec/phpspec": "^2.5",  
    "symfony/var-dumper": "^3.0",   
    "vlucas/phpdotenv": "^2.2"

Also in your require attribute make sure keep minimal dependencies. Remove unused packages here

You can only keep

"require": {
    "magento/product-community-edition": "2.3.3"
},
| improve this answer | |
0

I have update my Magento version using following steps:

Note: Backup files and database before performing anything

1.Add or remove specific packages based on your needs. For example, if you are upgrading from Magento Open Source to Magento Commerce, remove the Magento Open Source package.

composer remove magento/product-community-edition --no-update

2.Magento Open Source:

composer require magento/product-community-edition=2.3.3 --no-update

3.Specify additional packages.

composer require --dev allure-framework/allure-phpunit:~1.2.0 friendsofphp/php-cs-fixer:~2.14.0 lusitanian/oauth:~0.8.10 magento/magento-coding-standard:~3.0.0 magento/magento2-functional-testing-framework:2.4.5 pdepend/pdepend:2.5.2 phpmd/phpmd:@stable phpunit/phpunit:~6.5.0 sebastian/phpcpd:~3.0.0 squizlabs/php_codesniffer:~3.4.0 --sort-packages --no-update

4.Remove unused packages.

composer remove --dev sjparkinson/static-review fabpot/php-cs-fixer --no-update

For more read Magento docs

https://devdocs.magento.com/guides/v2.3/comp-mgr/cli/cli-upgrade.html

Other useful resources :

  1. https://www.goivvy.com/blog/magento-2-upgrade 2.How to Upgrade magento version from 2.2.X to 2.3.0?
| improve this answer | |
0

In my case I find out one of my module has this code

"require": {
  "magento/framework": "101.*.*"
},

and due to this dependency I am not able to update, so I contact extension vendor and tell them to update this dependency at their repo

| improve this answer | |
0

reinventing the wheel? have you tried to run this script?

https://devdocs.magento.com/guides/v2.3/comp-mgr/cli/upgrade-with-script.html

Upgrading your Magento installation with our script, which makes the upgrade process semi-automated, is the preferred method.

Use the manual process if you previously made updates to the same values that the upgrade script affects, because the script will override those values.

The upgrade script:

Updates Magento with the 2.3 requirements.

  • Backs up the composer.json file.
  • Specifies the new version of the Magento metapackage.
  • Updates the "require-dev" section in the composer.json file.
  • Adds "Zend\Mvc\Controller\":"setup/src/Zend/Mvc/Controller/" to the "autoload":"psr-4" section in the composer.json file.
  • Backs up and updates the magento/updater, if it has been installed.
  • Updates the "name", "version", and "description" fields in the composer.json file.

https://github.com/magento/magento2/blob/2.4-develop/dev/tools/UpgradeScripts/pre_composer_update_2.3.php

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.