Wednesday, 30 September 2020

 

How to Upgrade magento version from 2.3.x [EE] to 2.3.x [EE]



Here are the steps I used to successfully update Magento 2.3.3 [EE] to 2.3.5 [EE] I have divided the steps into parts:

Here are the steps to upgrade Magento 2.3.x to 2.3.x

Upgrade Magento 2 using composer: –

  • Backup code and database
  • Backup the composer.json & index.php file.
  • cp composer.json composer.json.bak
  • cp index.php index.php.bak
  • php bin/magento deploy:mode:set developer
  • php bin/magento cache:disable
  • php bin/magento maintenance:enable
  • composer require magento/product-enterprise-edition=2.3.5 –no-update

–> Message : ./composer.json has been updated.

  • composer update

–> PHP Fatal error:

Uncaught Error: Undefined class constant ‘PRE_COMMAND_RUN’ in /var/www/html/m23x/ontime/vendor/laminas/laminas-dependency-plugin/src/DependencyRewriterPlugin.php:63

–> composer –version

–> Solution:

  • It’s just because of the composer’s old version, you need to install the new version (composer version >= Composer 1.9.1)
  • composer update
  • rm -rf var/cache/* var/page_cache/* generated/code/*
  • php bin/magento setup:upgrade

Error: Element ‘route’: Missing child element(s). Expected is ( resources ).

Solution: Magento_MysqlMq [disable this module]

  • php bin/magento setup:di:compile

Errors:

  1. Fatal error: Declaration of

Magento\PageBuilder\Model\Dom\NodeList::item($index): ?Magento\PageBuilder\Model\Dom\Adapter\ElementInterface must be compatible with Magento\PageBuilder\Model\Dom\Adapter\NodeListInterface::item(int $index): ?Magento\PageBuilder\Model\Dom\Adapter\ElementInterface in /var/www/html/m23x/ontime/vendor/magento/module-page-builder/Model/Dom/NodeList.php on line 19

Solution:

vendor/magento/module-page-builder/Model/Dom/NodeList.php (On line 47 change as follows) public function item(int $index): ?ElementInterface

  • php bin/magento cache:enable
  • php bin/magento maintenance:disable
  • php bin/magento deploy:mode:set production –skip-compilation
  • service varnish restart [If you use Varnish for page caching, restart it.]
  • php bin/magento indexer:reindex && php bin/magento cache:clean && php bin/magento cache:flush

SUCCESSFULLY UPGRADED – MAGENTO 2.3.3 To MAGENTO 2.3.5 [EE]

replace OLD index.php file

  • rm -rf var/cache/* var/view_preprocessed/* generated/* pub/static/*
  • php bin/magento setup:upgrade
  • php bin/magento setup:di:compile
  • php bin/magento setup:static-content:deploy -f

You may face the below issue at the time of deploying.

1) Error:

The contents from the “/var/www/html/pub/static/adminhtml/Magento/backend/en_US/requirejs-min-resolver.min.js” file can’t be read. Warning!

file_get_contents(/var/www/html/pub/static/adminhtml/Magento/backend/en_US/requirejs-min-resolver.min.js): failed to open stream: No such file or directory.

Solution: Disable Minify CSS / JS OR JS/CSS Merge

  • php bin/magento config:set dev/js/merge_files 0
  • php bin/magento config:set dev/js/enable_js_bundling 0
  • php bin/magento config:set dev/js/minify_files 0
  • php bin/magento config:set dev/css/merge_css_files 0
  • php bin/magento config:set dev/css/minify_files 0

++++++++++++++++++++++++++

  • php bin/magento indexer:reindex && php bin/magento c:c && php bin/magento c:f
  • chmod -R 777 var/ generated/ pub/static/
  • service varnish restart

+++++++++++++++++++++++

Checkout page errors:–

  1. Magento 2.3.4 Checkout Infinite loop detected.

Infinite loop detected, review the trace for the looping path.

Bug in Code File of 2.3.5

Message:

vendor/magento/module-checkout/Model/Session.php line 240 code is a bug On line 240 we have the code: if ($this->isLoading) { … which throw this exception. The private member $isLoading is set to false by default and is only set to true on line number 243 in the Session.php the code will never reach this line as the Quote is not already created and need to be created at line number 244 but we are throwing an error on line 241 which breaks the script. No matter what we select in the payment method the code always breaks.

Temp Solution:

vendor/magento/module-checkout/Model/Session.php Try to replace this file with version 2.3.3 and try to checkout again.

+++++++++++

Note: Vendor file changes as follows below.

vendor/magento/module-checkout/Model/Session.php

vendor/magento/module-page-builder/Model/Dom/NodeList.php


  How to Upgrade magento version from 2.3.x [EE] to 2.3.x [EE] Here are the steps I used to successfully update Magento 2.3.3 [EE] to 2.3.5 ...