Skip to content

Instantly share code, notes, and snippets.

@agehlot
Last active October 2, 2022 15:14
Show Gist options
  • Save agehlot/30a5bf5a3ecf09b5fbbaff7cfa57b2bf to your computer and use it in GitHub Desktop.
Save agehlot/30a5bf5a3ecf09b5fbbaff7cfa57b2bf to your computer and use it in GitHub Desktop.
These are the SQL scripts that can be used to delete all contacts and their interactions and make the xdb clean.
USE [yourdatabaseprefix.Collection.ShardX]
GO
DELETE FROM [xdb_collection].ContactIdentifiers
Delete from [xdb_collection].ContactFacets
Delete from [xdb_collection].InteractionFacets
Delete from [xdb_collection].Interactions
Delete from [xdb_collection].Contacts
--For Sitcore 9.3
Delete from [xdb_collection].ContactIdentifiersIndex
Delete from [xdb_collection].DeviceProfileFacets
Delete from [xdb_collection].DeviceProfiles
Delete from [xdb_collection].DeviceProfileFacets
Delete from [xdb_collection].DeviceProfileFacets
--You also need to clean the interactions out of the processing pool
TRUNCATE TABLE [xdb_processing_pools].[InteractionLiveProcessingPool]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment