Sitecore-Instance-Manager
Sitecore-Instance-Manager copied to clipboard
SIM does not delete databases from SQL Server that was actually used during installation
Description:
SIM does not delete databases from SQL Server that was actually used during installation
Scenario:
- Install at least two SQL Server engines, for example SQL Server 2017 and 2019
- In SIM (v1.13.0) settings, set connection string to use SQL Server 2017
- Install Sitecore XP 9.x+
- In SIM settings, set connection string to use SQL Server 2019
- Delete instance from step (3)
Expected result: databases are deleted from SQL Server 2017 Actual result: SIM did not delete databases
Issue is actual
I hereby confirm the issue is new:
- all prerequisites are met.
- it is not a known issue
- it was not discussed before (I used GitHub Issues search)
Valid for QA/DEV
Haven't checked in the latest QA/DEV version
Screenshots: n/a
Attachments:
n/a
The solution could be:
- Add the ability to have a list of SQL servers available for installation/uninstallation of Sitecore
option#1: during uninstallation check, if the connection string points to the database server that is in the SIMs SQL server list. In case the database is not hosted on the SQL server in the list, it must not be deleted. option#2: check a database name on all SQL servers known by SIM, once the database is found we can safely remove it.
While developing, I found that the existing "Profile.ConnectionString" property that represents the existing connection string is widely used through code in the following places:
SIM.Tool.Base.EnvironmentHelper.CheckSqlServer
SIM.Tool.Windows.Pipelines.Setup.SetupProcessor.Execute
SIM.Tool.Windows.Pipelines.Setup.SetupWizardArgs.SetupWizardArgs
SIM.Tool.Base.Profiles.ProfileManager.GetConnectionString
The 'SIM.Tool.Base.EnvironmentHelper.CheckSqlServer' method is used in too many places to check if the defined SQL server is running. Based on this, introducing a possibility to add more SQL servers is a breaking change that requires overriding of significant part of the existing functionality.