1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Upgrading magento2.3 to 2.3.3

Posted at

The Beginnings:

This is the article for [Magento 2 Advent Calendar 2018](https://adventar.org/calendars/4213) 25th day of 2019.

In this article, I am going to describe some of my experience in upgrading magento2.3.0 to 2.3.3 and its consequences errors and important steps to take care off before starting up.

Execution Enviroment

Magento 2.3.0 PHP 7.1.23 MySQL 5.7.24 Apache 2.4.29

Steps to reproduces:

1. Back up the magento2.3 database 2. Back up composer.json file from root in the Magento installation directory. 3. use command: composer require magento/product-community-edition=2.3.3 --no-update 4. composer update

consequent errors might occurs:

Unfortunately using above command is not to be and we would stuck into something like the following: 1. スクリーンショット 2019-04-10 16.10.46.png if this type of error occurs, then we need to remove all the third party extensions from composer.json and try once again.
  1. "The following exception is caused by a lack of memory or swap, or not having swap configured
    Check https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details"
    solution: use this command:
    php -d memory_limit=2G /usr/local/bin/composer update

If all goes well we will see the upgrade process happening:
スクリーンショット 2019-12-25 22.05.13.png

Any errors at this stage are likely caused by the extensions that need to be upgraded at the same time as Magento to stay compatible.

Now that we have the latest code the only thing left to do is make sure that the database itself is also upgraded with.
Use this command:

bin/magento setup:upgrade

And then we can confirm in the admin that we have upgraded to 2.3.3.
スクリーンショット 2019-12-25 22.44.29.png

After successful upgrade to 2.3.3 you may also face other consequent errors.

1. Catalog pagination issue on Elasticsearch 2. Email Message Interface backward compatibility error 3. Uncaught TypeError: urldecode() expects parameter 1 to be string, boolean given in (in CommunityEngineering/JapaneseUrlRewrite) 4. Warning: Declaration of CommunityEngineering\JapaneseName\Model\DataObject\Copy::setAttributeValueFromExtensibleDataObject($target,$code,$value)... 5. Insufficient inventory error when shipping items 6. When creating a cancellation / credit memo, it will get an error that the product cannot be returned 7. Even if the available quantity is 0, the product will still be displayed on the product list page.

Solution for those errors:

1. Catalog_pagination_issue_on_Elasticsearch_6_composer-2019-10-11-08-07-41.patch this is security patches which needs to be applied command: in shell use patch -p1 < Catalog_pagination_issue_on_Elasticsearch_6_composer-2019-10-11-08-07-41.patch
  1. EmailMessageInterface_2.3.3_backward_compatibility_composer-2019-10-30-10-20-09.patch this is another patches needs to be inserted
    command: in shell use patch -p1 < EmailMessageInterface_2.3.3_backward_compatibility_composer-2019-10-30-10-20-09.patch

  2. CommunityEngineering/JapaneseUrlRewrite needs to be disabled
    php bin/magento module:disable:CommunityEngineering_JapaneseUrlRewrite

  3. add some lines in CommunityEngineering/JapaneseName/Model/DataObject/Copy.php

    • use Magento\Framework\Api\ExtensibleDataInterface;
    • protected function setAttributeValueFromExtensibleDataObject(ExtensibleDataInterface $target, $code, $value)
    スクリーンショット 2019-12-25 22.52.24.png
  4. first confirm the order data only using : php bin/magento inventory:reservation:list-inconsistencies
    then use this command:
    bin/magento inventory:reservation:list-inconsistencies -r | bin/magento inventory:reservation:create-compensations

  5. use this command to solve above one : insert into inventory_shipment_source(shipment_id, source_code) values({ShipmentId}, {return stock source_name})

  6. use this sql:
    SELECT
    e.entity_id,
    csi.is_in_stock,
    isi.quantity + SUM(ir.quantity) as salable_quantity
    FROM
    catalog_product_entity AS e
    LEFT JOIN inventory_source_item isi ON e.sku=isi.sku
    LEFT JOIN inventory_reservation ir ON e.sku = ir.sku
    LEFT JOIN cataloginventory_stock_item as csi on e.entity_id=csi.product_id
    GROUP BY e.sku
    HAVING salable_quantity=0 and is_in_stock=1;
    and check if salable_quantity=0 then change the status to out_of_stock.

In short

There are lot more problems occurred in upgrading 2.3.3 and most of them are likely solved during upgrading process. I was stucked into those problems and tried to find out the solution for those errors. And finally able to solve those problem just googling and consulting to friends. So, before upgrading to 2.3.3 we need to take care lot of steps and the above steps may help to someone else who tries to do the same as I had done before.
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?