Restoring the Shared Environments database in Sitecore Experience Commerce might result in catalog corruption if the ParentId for the Catalog entry in the Mappings table differs from the ID of the Catalogs item in the Master database. The issue can occur in the following cases:
In both cases, the parent ID of the catalog entry in the mapping table will be different from the ID of the Catalogs Item ID in the Master DB.
There are the following symptoms:
...
[Index=sitecore_master_index] : AllCatalogItemsCrawler Indexed 0 items, skipped 7745 orphaned items.
...
When experiencing these symptoms, first check the following:
SELECT *
FROM [Your_SharedEnvironments].[sitecore_commerce_storage].[Mappings]
where EntityId like '%entity-catalog%'
To resolve the issue, consider the following solution:
DELETE
FROM [Your_SharedEnvironments].[sitecore_commerce_storage].[Mappings]
WHERE EntityId = 'Entity-Catalog-[Catalog name from query above]' AND ParentId = '[Invalid Parent Id from query above]'