Sitecore-Instance-Manager icon indicating copy to clipboard operation
Sitecore-Instance-Manager copied to clipboard

SIM does not delete databases from SQL Server that was actually used during installation

Open SC-IDO opened this issue 3 years ago • 2 comments

Description:
SIM does not delete databases from SQL Server that was actually used during installation

Scenario:

  1. Install at least two SQL Server engines, for example SQL Server 2017 and 2019
  2. In SIM (v1.13.0) settings, set connection string to use SQL Server 2017
  3. Install Sitecore XP 9.x+
  4. In SIM settings, set connection string to use SQL Server 2019
  5. 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:

Valid for QA/DEV
Haven't checked in the latest QA/DEV version

Screenshots: n/a

Attachments:
n/a

SC-IDO avatar Feb 16 '22 09:02 SC-IDO

The solution could be:

  1. 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.

AndreyFilchenkov avatar Jan 18 '23 14:01 AndreyFilchenkov

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.

DmitryKolinchuk avatar Jan 24 '23 07:01 DmitryKolinchuk