Publishable items are deleted during publishing


Description

Publishing an item that is stored in resources, for example, in /sitecore, might result in the deletion of all non-resource items in the target database. This happens if the target database contains an item version that overrides the resource item, for instance if the /sitecore  item was edited in the target database.

Solution

To resolve the issue, upgrade your instance to Sitecore 10.3.

To mitigate the issue, run a cleanup command on the target database to delete the items that override the default resource items. For more details, refer to:

https://doc.sitecore.com/xp/en/developers/101/developer-tools/the-cli-itemres-command.html#the-cleanup-subcommand