Sync feeds using the Commerce CLI
The saas:resync command in the magento/saas-export package lets you manage data synchronization for Adobe Commerce SaaS services.
saas:resync command also applies to Adobe Commerce Optimizer Connector feeds such as products, categories, and priceBooks. See Supported feeds for the full list of connector feeds and indexer names.Adobe does not recommend using the saas:resync command regularly. Typical scenarios for using the command are:
- Initial sync
- Sync data to a new data space after changing the SaaS Data Space ID
- Troubleshooting
Monitor sync operations in the var/log/saas-export.log file.
Initial sync
aco:config:init command schedules the initial full sync by invalidating all connector feed indexers. See Enable the Commerce Optimizer integration and Manage synchronization to Commerce Optimizer.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.
Feed syncs can be run in any order - there are no hard dependencies between them. The following sequence starts with scope data first, which is a logical starting point since scopes define the store views that other feeds reference.
bin/magento saas:resync --feed scopesWebsite
bin/magento saas:resync --feed scopesCustomerGroup
bin/magento saas:resync --feed productAttributes
bin/magento saas:resync --feed categories
bin/magento saas:resync --feed products
bin/magento saas:resync --feed prices
bin/magento saas:resync --feed variants
bin/magento saas:resync --feed productoverrides
Command options
The saas:resync command supports various sync operations:
- Partial sync by SKU
- Resume interrupted syncs
- Validate data without syncing
View all command options and flags:
bin/magento saas:resync --help
See the following sections for option descriptions with examples.
--feed
Required. Specifies the feed entity to resync.
bin/magento saas:resync --help documents command options and flags. It does not list every feed available in your environment. For the full feed list with CLI feed names, indexer IDs, and feed tables, see Supported feeds.
productOverrides requires Adobe Commerce on cloud, on premises, or Commerce as a Cloud Service, and orders requires the Sales Orders module.Example:
bin/magento saas:resync --feed products
--by-ids
Partially resync specific entities by their IDs. Supports products, productAttributes, productOverrides, inventoryStockStatus, prices, variants, and categoryPermissions feeds.
By default, when you use the --by-ids option you specify values using product SKU values. To use product IDs instead, add the --id-type=productId option.
Examples:
bin/magento saas:resync --feed products --by-ids='ADB102,ADB111,ADB112'
bin/magento saas:resync --feed products --by-ids='1,2,3' --id-type='productId'
--cleanup-feed
Clean up the feed indexer table before reindexing and sending data to SaaS. Only supported for products, productAttributes, productOverrides, inventoryStockStatus, prices, variants, and categoryPermissions.
If used with the --dry-run option, the operation performs a dry-run resync operation for all items.
cleanup-feed option clears the local feed export state and can lead to incomplete synchronization. For example, entity deletions in Adobe Commerce may not be reflected in connected Commerce Services, or stale entities may remain in the remote Commerce Services indexes even though they were deleted or updated in Adobe Commerce. Use this option only for full environment rebuilds, such as after a SaaS data space cleanup.Example:
bin/magento saas:resync --feed products --cleanup-feed
--continue-resync
Resumes an interrupted resync operation. Only supported for products, productAttributes, and productOverrides feeds.
Example:
bin/magento saas:resync --feed productAttributes --continue-resync
--dry-run
Runs the feed reindex process without submitting the feed to SaaS and without saving to the feed table. This option is useful to identify any issues with your data set.
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 products --dry-run
Test specific feed items
Test specific feed items by adding the --by-ids option with the extended logs collection to see the generated payload in the var/log/saas-export.log file.
Example:
EXPORTER_EXTENDED_LOG=1 bin/magento saas:resync --feed products --dry-run --by-ids='ADB102,ADB111,ADB112'
Test all feed items
By default, the feed submitted during a resync --dry-run operation includes only new items, or items that failed to be exported previously. To include all items in the feed to be processed, use the --cleanup-feed option.
Example:
bin/magento saas:resync --feed products --dry-run --cleanup-feed
--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 productAttributes --no-reindex