Recently I did a lot of test installs of K2 blackpearl reusing the same machines. I.e. it was necessary for me to remove everything related to K2 blackpearl before I can install it again on the same server. Below you may find few notes/observations with regards to this.
In order to remove K2 blackpearl you just run K2 blackpearl Setup Manager on your server and select “Remove K2 blackpearl”:
This will remove all K2 components from your server and will ask you for reboot. Once this is done the following things still have to be removed if your goal is to clean up everything and start from scratch:
1) Some files may still remain in the following folders:
%ProgramFiles(x86)%\K2 blackpearl%ProgramData%\SourceCode
%UserProfile%\AppData\Local\SourceCode_Technology_Hol
If your goal is full clean up you can remove all these folders given the fact that you uninstalled all your K2 components via Setup Manager before hand and there is no K2 components listed in Programs and Features list (appwiz.cpl). NOTE: If you have SmartForms or other additional components you do uninstall in reverse order – last component installed being removed first and so on.
2) Self-signed certificates for K2 server and sites not being removed from Personal Machine store on your K2 server. If your goal is full clean up you may want to remove them too.
3) K2 database not being deleted too, for complete clean up you should drop/remove it on SQL server.
4) I also noticed that in my case K2WTS service has not been removed correctly by Setup Manager during removal process. K2WTS service also known under display name “K2 Claims To Windows Token Service.” Here is an example how to check if it is still present after removal of K2 blackpearl via PowerShell:
Get-WmiObject -Class Win32_Service -Filter "Name='K2WTS'"
Below sample output in case service is still present:
No output means that no service with such name found.
And this is how to remove via PowerShell:
Get-WmiObject -Class Win32_Service -Filter "Name='K2WTS'" | Remove-WmiObject
Of course there are other ways to remove service in Windows as Remove-WmiObject available only in PS 3.0 or newer. You can also use sc.exe or even locate and delete relevant entry in registry using regedit.exe
Also only after writing this blog post I accidentally discovered relevant section in official K2 documentation which covers this topic: K2 blackpearl Installation and Configuration Guide > Maintenance > Remove > Manual Environment Clean Up