Catalog Sync
Adobe Commerce uses indexers to compile catalog data into tables. The process is automatically triggered by events such as a change to a product price or inventory level.
The Catalog Sync service moves product data from an Adobe Commerce instance to the Commerce Services platform on an ongoing basis to keep the data up to date. For example, Product Recommendations requires current catalog information to accurately return recommendations with correct names, pricing, and availability. Use the Catalog Sync dashboard to observe and manage the synchronization process or the command-line interface to trigger a catalog sync and to reindex product data for consumption by Commerce Services.
Accessing the Catalog Sync dashboard
To access the Catalog Sync dashboard, select System > Data Transfer > Catalog Sync.
With the Catalog Sync dashboard you can:
- View the sync status (In Progress, Success, Failed)
- View the total number of products synced
- Search synced products to view their current state
- Search store catalog by name, SKU, etc.
- View synced product details in JSON to help diagnose a sync discrepancy
- Reinitiate the sync process
Last sync
Reports a sync status of:
- Success - Displays the date and time that the sync was successful and the number of products updated
- Failed - Displays the date and time that the sync was attempted
- In Progress - Displays the date and time of the last successful sync
The catalog sync process automatically runs every hour. If you do not see expected products on the storefront, or if the products do not reflect recent changes you made, you can resolve catalog sync issues.
Products synced
Displays the total number of products synced from your Commerce catalog. After the initial sync, only changed products should be synced.
Resync resync
If you must initiate a resync of your catalog before the hourly scheduled sync occurs, you can force a resync.
-
From the Catalog Sync dashboard, select Settings.
The Catalog Sync Settings page appears.
-
In the Resync Data section, click Resync.
Commerce syncs your catalog during the next scheduled sync window. Depending on the size of your catalog, this operation can take a long time.
Synced catalog products
The Synced catalog products table displays the following information.
Resolve catalog sync issues resolvesync
When you trigger a data resync, it may take up to an hour for the data to update and be reflected in UI components such as recommendation units. If you still see discrepancies between your catalog and data on the storefront, or if the catalog sync failed, refer to the following:
Data discrepancy
- Display the detailed view of the product in question in the search results.
- Copy the JSON output and verify that the content matches what you have in the Commerce catalog.
- If the content does not match, make a minor change to the product in your catalog, such as adding a space or a period.
- Wait for a resync or trigger a manual resync.
Sync not running
If the sync is not running on a schedule or nothing is synced, see this KnowledgeBase article.
Sync failed
If the catalog sync has a status of Failed, submit a support ticket.
Command-line interface resynccmdline
The saas:resync
command is part of the magento/saas-export
package and is available out of the box with one of the Commerce Services products, such as Product Recommendations or Live Search.
productattributes
feed first, followed by productoverrides
, before running the products
feed.Command options:
bin/magento saas:resync --feed <feed name> [no-reindex|cleanup-feed]
The following table describes the saas:resync
parameters and descriptions.
feed
products
no-reindex
cleanup-feed
The feed name can be one of the following:
products
– Products in your catalogproductattributes
– Product attributes such asactivity
,gender
,tops
,bottoms
, and so onvariants
– Product variations of a configurable product, such as color and sizeprices
– Product pricesscopesCustomerGroup
– Customer GroupsscopesWebsite
– Websites with Store Viewscategories
– Categories in your catalogcategoryPermissions
- Permissions for each of the categoriesproductoverrides
– Customer-specific pricing and catalog visibility rules, such as those based on category permissions
Depending on which Commerce Services are installed, you may have different set of feeds available for saas:resync
command.
It is not recommended to run the saas:resync
command on regular basis. You may need to run command manually in two scenarios:
- The initial sync
- The SaaS Data Space ID was changed
Initial Sync
When you trigger a saas:resync
from the command line, depending on your catalog size, it may take from a few minutes to a few hours for the data to update.
For the initial sync, it is recommended to run commands in the following order:
bin/magento saas:resync --feed productattributes
bin/magento saas:resync --feed products
bin/magento saas:resync --feed scopesCustomerGroup
bin/magento saas:resync --feed scopesWebsite
bin/magento saas:resync --feed prices
bin/magento saas:resync --feed productoverrides
bin/magento saas:resync --feed variants
bin/magento saas:resync --feed categories
bin/magento saas:resync --feed categoryPermissions
Troubleshooting
If you do not see expected data in Commerce Service, check if a problem occurred during the sync from the Adobe Commerce instance to the Commerce Service platform.
There are two log files in the var/log/
directory:
commerce-data-export-errors.log
- if an error happened during collecting phasesaas-export-errors.log
- if an error happened during transmitting phase
Check feed payload
It may be useful to see the feed payload that has been sent to the Commerce Service. This can be done by passing the environment variable EXPORTER_EXTENDED_LOG=1
. The no-reindex
flag means that only currently collected data is sent.
EXPORTER_EXTENDED_LOG=1 bin/magento saas:resync --feed=products --no-reindex
The payload is available in var/log/saas-export.log
.
Preserve payload in feed index table
Stating from magento/module-data-exporter:103.0.0
some feeds: product feed, price feeds, keep only the minimum required data in the index table.
Preserving payload data in the index table is not recommended on production, but it may be useful on a developer instance. This is done by passing the PERSIST_EXPORTED_FEED=1
environment variable:
PERSIST_EXPORTED_FEED=1 bin/magento saas:resync --feed=products
Profiling
If the reindex process of specific feed takes an unreasonable amount of time, run the profiler to collect additional data that might be useful for the Support Team. To do so, pass the EXPORTER_PROFILER=1
environment variable:
EXPORTER_PROFILER=1 bin/magento indexer:reindex catalog_data_exporter_products
Profiler data is stored in var/log/commerce-data-export.log
with the format:
<Provider class name>, <# of processed entities>, <execution time im ms>, <memory consumption in Mb>
Submit a support request
If you see errors not related to configuration or third-party extensions, submit a support ticket with as much information as possible.