Cleanup tool for removing sharepoint integrated K2 Artifacts after user deletes sharepoint site
The normal procedure for removing K2 for SharePoint integration is the following:
1) Do a delete all on the lists/libraries with generated artifacts.
2) Run the uninstall option from the K2 App in site contents
It is apparent though that customers will either not know to delete K2 first due to lack of knowledge or also some customers have decommissioned complete SharePoint Farms at a time if a developer leaves their company. This has happened across many customers/tickets.
In this scenario we can either attempt to recreate the site (rarely a possibility) or we then need to clean out the database for all leftover artifacts/attempt to delete from the K2 Designer UI. This process can get lengthy and cumbersome for the customer as well as Support.
I would request we create a cleanup tool that can remove all of the related objects and entries from the database. Putting a notice when deleting the site might work, but the customer could delete a site outside of the UI and not get shown this message. At a high level overview I believe a tool that runs the same code to delete all across all setting IDs tied to a specified site URL (user input) and then do an uninstall would be best. Other option may be a stored procedure as most of the data just needs to be removed from the DB.
