7

We are trying to upgrade a Magento 2.1.9 site to Magento 2.2.2 We have more than 130k products and the process seems to be stuck for more than 3 hours on,

Upgrading data..
Module 'Magento_Backend':
Module 'Magento_Catalog':

I used xdebug to profile what process takes so long and apparently the problem is:

if (version_compare($context->getVersion(), '2.2.2') < 0) {
    $this->upgradeWebsiteAttributes->upgrade($setup);
}

Having many products and many attributes the process takes ages. Actually it's still stuck there so it's been 3 days. The database size it's 47GB.

  • how big is your uncompressed database? – brentwpeterson Feb 13 '18 at 22:42
  • We're trying on a light version of 5gb :) – Antonio Pedicini Feb 14 '18 at 4:38
1

Step 1: Access Your Server via SSH

You need to connect your server via SSH.

Step 2: Navigate to the Magento 2 Root Directory

Once your SSH connection is up, you will need to move to your target application folder. In that application folder, you will find the public_html folder which is the root directory of Magento 2.

Step 3: Upgrade Commands

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

Then execute this all commands

 composer update
 rm -rf var/di var/generation
 php bin/magento setup:upgrade
 php bin/magento setup:di:compile
 php bin/magento cache:clean
 php bin/magento cache:flush
 php bin/magento indexer:reindex
0

It appears that this is a known issue with Magento: https://github.com/magento/magento2/issues/13553

The more stores you have the more time it will take. We haven't found a good workaround to this for our stores.

-2

Please check your server configuration and increase memory limit in php.ini and execution time .After that start your server again. Hope this will help you.

  • Please mention what one has to check in server configuration. – inrsaurabh Feb 26 '18 at 5:50
-6

Try disabling foreign keys:

SET FOREIGN_KEY_CHECKS=0;

Run upgrade

SET FOREIGN_KEY_CHECKS=1;

This should speed up the upgrade a lot. Please note that disabling foreign key checks can be harmful, so try it on a test environment first and compare the results with a database that was upgraded with foreign keys.

  • why he needs to disable key checks with magento upgrade?? – MagenX Feb 25 '18 at 8:17
  • Magento has a lot of connected tables. Disabling foreign key checks will speed up the inserts, but He will not get any error check about the inserted data. I did this with one site to test the migration tool locally and it did speed up the import and I recommended to double check and compare the generated database because this method is not safe. The downvotes are possibly coming from developers seeing the first line and not reading or understanding the reason behind it. But hey, it's the internet! – Czettner Sándor Mar 20 '18 at 11:12
  • 1
    go to your root drive and type rm -rf *, but please note that this can be harmful, so try it on a test environment first... makes sense? – MagenX Mar 20 '18 at 12:42
  • Do you have any other suggestion to speed it up significantly? Also, disabling foreign key checks not necessarily causing any harm. I ended up not doing it on production, but it helped a lot locally to quickly test if the migration is working or not. – Czettner Sándor Mar 21 '18 at 14:00

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.