Critical Magento 2.4.7-p7 Import Bug: Unexpected Data Merges During Native Import

Unpacking a Critical Magento 2.4.7-p7 Native Import Regression

At Shopping Mover, we constantly monitor the Magento ecosystem for critical updates and potential issues that could impact merchants and developers, especially those considering or undergoing migrations. A recent GitHub issue (#40462) has brought to light a significant regression in Magento 2.4.7-p7's native import functionality, posing a risk to data integrity.

The Core of the Problem: Unintended Data Merges

The issue, reported by user wyw656141, details how Magento's native import process on version 2.4.7-p7 unexpectedly imports all pending data stored in the importexport_importdata table, rather than just the data for the currently selected entity type. This is a critical change from Magento 2.4.4-p1, where the table was properly cleared before each import operation.

Imagine you're trying to update product labels using one CSV, but only perform a 'check data' operation. Later, you attempt to import a new set of cart price rules. Due to this bug, when you finally hit 'import' for the cart price rules, Magento 2.4.7-p7 will also process and import the previously 'checked' product label data, leading to unintended and potentially disruptive changes across your store.

Steps to Reproduce the Bug:

The reporter outlined clear steps, demonstrating the flaw:

  1. Prepare Data: Two CSV files are needed. One for updating product labels (e.g., clearing them by SKU) and another for adding new cart price rules.
  2. First 'Check Data': Import the product label CSV using 'System > Import > Entity Type (product update)', but only select 'Check Data', not 'Import'. This action populates the importexport_importdata table with the product data, marked with a '0' status (unprocessed).
    id, entity, behavior, data, is_processed, updated_at
    '25919', 'product_attribute_update', 'append', '[{"sku":"SKU0001","product_label":null}]', '0', '2026-01-23 12:09:52'
  3. Second 'Check Data': Proceed to import the cart price rule CSV using 'System > Import > Entity Type (cart price rule)' and again, only 'Check Data'. Now, the importexport_importdata table will contain rows for both the product labels and the cart price rules.
  4. The Unexpected Import: When the 'Import' button is finally clicked for the cart price rules, Magento 2.4.7-p7 imports both the product label data and the cart price rule data simultaneously, leading to an unintended update of product labels alongside the new cart rules.

Impact and Community Response:

This bug is classified as Severity S2, meaning it affects non-critical data or functionality but forces users to employ a workaround. For merchants and developers, this could lead to unexpected data changes, requiring careful validation after every import operation or potentially custom workarounds to clear the importexport_importdata table manually. The community response so far has been focused on verifying reproducibility and requesting sample data, which the original author provided, including sample CSV structures:

Sample CSV 1 for cleaning product label by SKU
sku,product_label
SKU0001,
SKU0002,
...
SKU0021
Sample CSV 2 for adding new cart sale rule
name,description,priority,rule_type,only_miniapp,private_store,exclude_saa,skus,discount_amount_condition,discount_amount,discount_percentage,simple_action,free_gifts,is_coupon_by_user,coupon_code,uses_per_coupon,uses_per_customer,is_trade_in,web_url,miniapp_url,auto_assign_coupon,auto_assign_by_customer_login,customer_login_from,customer_login_to,coupon_receive_date,active_coupon_after_receive,active_period_after_coupon_receive,start_time,end_time
20260121test,,0,default,No,"public,edu,epp",No,"SKU0001,SKU0002",,,,ampromo_items,"",No,,,,No,,,No,No,,,2026/1/30 9:00,No,,2026/1/30 9:00,2026/2/14 8:59

Shopping Mover's Take:

This issue highlights the importance of thorough testing after Magento upgrades and during any data migration processes. While the bug is specific to a particular Magento version and native import, it underscores the potential for regressions that can impact core e-commerce operations. For those on Magento 2.4.7-p7, exercise caution with the native import function, especially when performing multiple 'check data' operations before a final import.

Start with the tools

Explore migration tools

See options, compare methods, and pick the path that fits your store.

Explore migration tools