Magento 2.3.x Data Migration: products show out of stock after migration

After migrating from Magento 1 to Magento 2.3.x, products can show as out of stock because the new MSI (Multi-Source Inventory) table inventory_source_item wasn't populated by the Data Migration Tool.

Back up the inventory_source_item table first, then run:

INSERT INTO `inventory_source_item` (source_code, sku, quantity, status)
SELECT 'default', sku, qty, stock_status
FROM (`cataloginventory_stock_status` AS `lg`
  JOIN `catalog_product_entity` AS `prd`
    ON ((`lg`.`product_id` = `prd`.`entity_id`)));

Then reindex: bin/magento indexer:reindex and flush cache.

Vikram · MagentoWorks

Magento & Adobe Commerce specialist since 2011. I do Hyvä migrations, speed optimization, security patching and hacked-store cleanup.

Get a free store checkup

Related reading

← All 99 posts