ACP2E-5009: Content Staging migration creates invalid updates and slows setup:upgrade
The ACP2E-5009 patch fixes the issue where the data patch that migrates Magento Open Source category and product dates to Content Staging scheduled updates in Adobe Commerce creates empty scheduled updates for categories, skips all product dates when empty date values remain from a previous run, and makes setup:upgrade very slow on catalogs with many categories and store views. This patch is available when the Quality Patches Tool (QPT) 1.1.84 is installed. The patch ID is ACP2E-5009. Please note that this issue is scheduled to be fixed in Adobe Commerce 2.4.10.
Affected products and versions
The patch is created for Adobe Commerce version:
- Adobe Commerce (all deployment methods) 2.4.8-p3
Compatible with Adobe Commerce versions:
- Adobe Commerce (all deployment methods) 2.4.5 - 2.4.9
magento/quality-patches package to the latest version and check the compatibility on the Quality Patches Tool: Search for patches page. Use the patch ID as a search keyword to locate the patch.Issue
The data patch that migrates Magento Open Source category and product dates to Content Staging scheduled updates in Adobe Commerce creates empty scheduled updates for categories, skips all product dates when empty date values remain from a previous run, and makes setup:upgrade very slow on catalogs with many categories and store views.
Prerequisites:
You are going to upgrade Magento Open Source to Adobe Commerce.
MigrateCatalogProducts data patch converts the category and product dates into Content Staging scheduled updates.To run the data patch again on Adobe Commerce, remove it from the patch_list table:
DELETE FROM patch_list WHERE patch_name = 'Magento\\CatalogStaging\\Setup\\Patch\\Data\\MigrateCatalogProducts';
Steps to reproduce:
Migration from Magento Open Source:
- On Magento Open Source, set Schedule Update From and To in the Schedule Design Update section of several categories. Leave To empty on some of them, and use both past and future dates.
- On several products, set a Special Price with Special Price From and To in Advanced Pricing, and set Set Product as New From and To, using both past and future dates.
- Install Adobe Commerce on this Magento Open Source database and run
bin/magento setup:upgrade. - Go to Content > Content Staging > Dashboard and check the scheduled updates created for the categories and products. Open the categories and products and check their Scheduled Changes box.
- Run the data patch again: remove it from the
patch_listtable (see Prerequisites), runbin/magento setup:upgrade, and checkvar/log/exception.log.
Performance:
- On Adobe Commerce, create 180 store views and 8,000 categories.
- Run
time bin/magento setup:upgradeand record the elapsed time. - Remove the data patch from the
patch_listtable (see Prerequisites) and runtime bin/magento setup:upgradeagain.
Expected results:
Migration from Magento Open Source:
- Each category with Schedule Design Update dates has a scheduled update that contains the category, with the same dates.
- Each product with Special Price or Set Product as New dates has a scheduled update with the same values and dates.
- Categories and products without dates have no scheduled updates.
- When the data patch runs again, empty product date values are ignored and no error is logged.
Performance:
The second setup:upgrade run completes quickly. The data patch skips the categories without scheduled design dates.
Actual results:
Migration from Magento Open Source:
- The scheduled updates created for the categories do not contain the categories.
- When the data patch runs again, it stops at the first empty product date value left by the previous run and migrates no product dates.
Performance:
- The second
setup:upgraderun takes about 47 minutes, compared with 14 seconds for the first run. - The data patch loads every category for every store view (about 1.4 million category loads for 180 store views and 8,000 categories) and makes no changes. Deployments on large catalogs can take hours.
Apply the patch
To apply individual patches, use the following links depending on your deployment method:
- Adobe Commerce or Magento Open Source on-premises: Quality Patches Tool > Usage in the Quality Patches Tool guide
- Adobe Commerce on cloud infrastructure: Upgrades and Patches > Apply Patches in the Commerce on Cloud Infrastructure guide
Related reading
To learn more about Quality Patches Tool, refer to:
- Quality Patches Tool: A self-service tool for quality patches in the Tools guide