Archiving Sitecore XDB Interaction Data
Quarterly Cleanup & Archiving of Sitecore XDB Interactions Requirement Delete all old interactions (above 1,000) for contacts that have more than 1,000 interactions. These interactions should be archived to a separate database before deletion. Note: Contacts must not be deleted. Frequency: This operation should be performed quarterly . Challenges Sitecore XConnect does not provide a direct API to delete only the interactions of a contact. Available APIs delete the entire contact along with its interactions, which is not acceptable for this use case. Implementation Approach Due to the limitations mentioned above, we will use a SQL Server Job to run a stored procedure quarterly. This procedure will: Archive interactions over the 1,000 mark for each contact to a separate database. Then delete those interactions and their facets from the main xdb_collection tables. ⚠️ Important: Update the database and table names according to your environment. Ste...