Sync feeds using the Commerce CLI
The saas:resync
command in the magento/saas-export
package lets you manage data synchronization for ÃÛ¶¹ÊÓƵ Commerce SaaS services.
ÃÛ¶¹ÊÓƵ does not recommend using the saas:resync
command regularly. Typical scenarios for using the command are:
- Initial sync
- Sync data to new data space after changing the SaaS Data Space ID
- Troubleshooting
Monitor sync operations in the var/log/saas-export.log
file.
Initial Sync
When you trigger a saas:resync
from the command line, depending on your catalog size, it can take from a few minutes to a few hours for the data to update.
For the initial sync, ÃÛ¶¹ÊÓƵ recommends running the 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
Sync using CLI commands
The saas:resync
command supports various sync operations:
- Partial sync by SKU
- Resume interrupted syncs
- Validate data without syncing
View all available options:
bin/magento saas:resync --help
See the following sections for option descriptions with examples.
--by-ids
Partially resync specific entities by their IDs. Supports products
, productAttributes
, and productOverrides
feeds.
By default, entities are specified by product SKU. Use --id-type=ProductID
to use product IDs instead.
Examples:
bin/magento saas:resync --feed='<FEED_NAME>' --by-ids='<SKU-1>,<SKU-2>,<SKU-3>'
bin/magento saas:resync --feed='<FEED_NAME>' --by-ids='<ID-1>,<ID-2>,<ID-3>' --id-type='productId'
--cleanup-feed
Cleans the feed indexer table before reindexing and sending data to SaaS. Only supported for products
, productOverrides
, and prices
feeds.
Example:
bin/magento saas:resync --feed='<FEED_NAME>' --cleanup-feed
--continue-resync
Resumes an interrupted resync operation. Only supported for products
, productAttributes
, and productOverrides
feeds.
Example:
bin/magento saas:resync --feed='<FEED_NAME>' --continue-resync
--dry-run
Runs the feed reindex process without submitting to SaaS or saving to the feed table. Use to validate data.
Add the EXPORTER_EXTENDED_LOG=1
environment variable to save payload to var/log/saas-export.log
.
Example:
EXPORTER_EXTENDED_LOG=1 bin/magento saas:resync --feed='<FEED_NAME>' --dry-run
--feed
Required. Specifies the feed entity to resync.
Available feeds:
categories
categoryPermissions
inventoryStockStatus
orders
prices
products
productAttributes
productOverrides
scopesWebsite
scopesCustomerGroup
variants
Example:
bin/magento saas:resync --feed='<FEED_NAME>'
--no-reindex
Resubmits existing catalog data to Commerce Services without reindexing. Not supported for product-related feeds.
Behavior varies by export mode:
- Legacy mode: Resubmits all data without truncating.
- Immediate mode: Option is ignored, only syncs updates/failures.
Example:
bin/magento saas:resync --feed='<FEED_NAME>' --no-reindex
Troubleshooting
If you do not see expected data in connected Commerce Services, troubleshoot issues by checking data export error logs and using the saas:resync
command with environment variables to review payloads and profiler data. See Review logs and troubleshoot.