Skip to content

Commit 084bb01

Browse files
authored
Merge pull request #116 from Keyfactor/release-2.4
Release 2.4.4 to main
2 parents f0a2bc8 + cb7d3c7 commit 084bb01

File tree

5 files changed

+44
-18
lines changed

5 files changed

+44
-18
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2.4.4
2+
* Fix an issue with WinRM parameters when migrating Legacy IIS Stores to the WinCert type
3+
* Fix an issue with "Delete" script in the Legacy IIS Migration that did not remove some records from dependent tables
4+
15
2.4.3
26
* Adding Legacy IIS Migration scripting and Readme guide
37

Migration-Scripts/Legacy-IIS/CreateWinCertStoreType.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ BEGIN TRY
139139
VALUES
140140
(
141141
@current_storetype_id, -- StoreTypeId
142-
'WinRm Protocol', -- Name
143-
'WinRm Protocol', -- DisplayName
142+
'WinRM Protocol', -- Name
143+
'WinRM Protocol', -- DisplayName
144144
2, -- Type
145145
1, -- Required
146146
NULL, -- DependsOn
@@ -160,8 +160,8 @@ BEGIN TRY
160160
VALUES
161161
(
162162
@current_storetype_id, -- StoreTypeId
163-
'WinRm Port', -- Name
164-
'WinRm Port', -- DisplayName
163+
'WinRM Port', -- Name
164+
'WinRM Port', -- DisplayName
165165
0, -- Type
166166
1, -- Required
167167
NULL, -- DependsOn

Migration-Scripts/Legacy-IIS/DeleteIISStores.sql

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,41 +27,59 @@ BEGIN TRY
2727
INNER JOIN [cms_agents].[CertStores] [cs] ON [csii].[CertStoreId] = [cs].[Id]
2828
INNER JOIN @IISStoreTypeIds [sti] ON [sti].[Id] = [cs].[CertStoreType];
2929

30+
DELETE [csmj]
31+
FROM [cms_agents].[CertStoreManagementJobs] [csmj]
32+
INNER JOIN [cms_agents].[AgentSchedules] [as] ON [csmj].[JobId] = [as].[JobId]
33+
INNER JOIN @IISJobTypeIds [jti] ON [jti].[Id] = [as].[JobTypeId];
34+
35+
DELETE [csms]
36+
FROM [dbo].[CertStoreManagementStaging] [csms]
37+
INNER JOIN [cms_agents].[CertStores] [cs] ON [csms].[CertStoreId] = [cs].[Id]
38+
INNER JOIN @IISStoreTypeIds [sti] ON [sti].[Id] = [cs].[CertStoreType];
39+
40+
DELETE [csmjs]
41+
FROM [cms_agents].[CertStoreManagementJobStaging] [csmjs]
42+
INNER JOIN [cms_agents].[CertStores] [cs] ON [csmjs].[StoreId] = [cs].[Id]
43+
INNER JOIN @IISStoreTypeIds [st] ON [st].[Id] = [cs].[CertStoreType];
44+
45+
DELETE [csrj]
46+
FROM [cms_agents].[CertStoreReenrollmentJobs] [csrj]
47+
INNER JOIN [cms_agents].[AgentSchedules] [as] ON [csrj].[JobId] = [as].[JobId]
48+
INNER JOIN @IISJobTypeIds [jti] ON [jti].[Id] = [as].[JobTypeId];
49+
3050
DELETE [cs]
3151
FROM [cms_agents].[CertStores] [cs]
3252
INNER JOIN @IISStoreTypeIds [st] ON [cs].[CertStoreType] = [st].[Id];
3353

3454
DELETE [csc]
3555
FROM [cms_agents].[CertStoreContainers] [csc]
36-
INNER JOIN @IISStoreTypeIds [st] ON [csc].[CertStoreType] = [st].[Id];
56+
INNER JOIN @IISStoreTypeIds [st] ON [csc].[CertStoreType] = [st].[Id];
3757

3858
DELETE [csij]
3959
FROM [cms_agents].[CertStoreInventoryJobs] [csij]
4060
INNER JOIN [cms_agents].[AgentSchedules] [as] ON [csij].[JobId] = [as].[JobId]
4161
INNER JOIN @IISJobTypeIds [jti] ON [jti].[Id] = [as].[JobTypeId];
4262

43-
DELETE [csrj]
44-
FROM [cms_agents].[CertStoreReenrollmentJobs] [csrj]
45-
INNER JOIN [cms_agents].[AgentSchedules] [as] ON [csrj].[JobId] = [as].[JobId]
46-
INNER JOIN @IISJobTypeIds [jti] ON [jti].[Id] = [as].[JobTypeId];
47-
48-
DELETE [csmj]
49-
FROM [cms_agents].[CertStoreManagementJobs] [csmj]
50-
INNER JOIN [cms_agents].[AgentSchedules] [as] ON [csmj].[JobId] = [as].[JobId]
51-
INNER JOIN @IISJobTypeIds [jti] ON [jti].[Id] = [as].[JobTypeId];
52-
5363
DELETE [as]
5464
FROM [cms_agents].[AgentSchedules] [as]
5565
INNER JOIN @IISJobTypeIds [jt] ON [jt].[Id] = [as].[JobTypeId];
5666

5767
DELETE [cstp]
5868
FROM [cms_agents].[CertStoreTypeProperties] [cstp]
59-
INNER JOIN @IISStoreTypeIds [st] ON [cstp].[StoreTypeId] = [st].[id];
69+
INNER JOIN @IISStoreTypeIds [st] ON [cstp].[StoreTypeId] = [st].[Id];
70+
71+
DELETE [cstep]
72+
FROM [cms_agents].[CertStoreTypeEntryParameters] [cstep]
73+
INNER JOIN @IISStoreTypeIds [st] ON [cstep].[StoreTypeId] = [st].[Id];
6074

6175
DELETE [cst]
6276
FROM [cms_agents].[CertStoreTypes] [cst]
6377
INNER JOIN @IISStoreTypeIds [st] ON [cst].[StoreType] = [st].[id];
6478

79+
DELETE [arg]
80+
FROM [cms_agents].[AgentRegistrationGroups] [arg]
81+
INNER JOIN @IISJobTypeIds [jt] ON [arg].[JobTypeId] = [jt].[Id];
82+
6583
DELETE [ars]
6684
FROM [cms_agents].[AgentRegistrationSettings] [ars]
6785
INNER JOIN @IISJobTypeIds [jt] ON [ars].[JobTypeId] = [jt].[Id];
@@ -70,6 +88,10 @@ BEGIN TRY
7088
FROM [cms_agents].[AgentCapabilities] [ac]
7189
INNER JOIN @IISJobTypeIds [jt] ON [ac].[JobTypeId] = [jt].[Id];
7290

91+
DELETE [jtf]
92+
FROM [cms_agents].[JobTypeFields] [jtf]
93+
INNER JOIN @IISJobTypeIds [jt] ON [jtf].[JobTypeId] = [jt].[Id];
94+
7395
DELETE [jt]
7496
FROM [cms_agents].[JobTypes] [jt]
7597
INNER JOIN @IISJobTypeIds [jti] ON [jt].[Id] = [jti].[Id];

Migration-Scripts/Legacy-IIS/UpgradeIISPersonalToWinCert.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ BEGIN TRY
204204
@win_cert_store_type_id,
205205
[psd].[StoreApproved],
206206
0,
207-
'{"WinRm Protocol":"'+@winrm_protocol+'","WinRm Port":"'+CONVERT(NVARCHAR(10),@winrm_port)+'","spnwithport":"'+@spnwithport+'","ServerUsername":"'+CONVERT(NVARCHAR(36),NEWID())+'","ServerPassword":"'+CONVERT(NVARCHAR(36),NEWID())+'","ServerUseSsl":"true"}',
207+
'{"WinRM Protocol":"'+@winrm_protocol+'","WinRM Port":"'+CONVERT(NVARCHAR(10),@winrm_port)+'","spnwithport":"'+@spnwithport+'","ServerUsername":"'+CONVERT(NVARCHAR(36),NEWID())+'","ServerPassword":"'+CONVERT(NVARCHAR(36),NEWID())+'","ServerUseSsl":"true"}',
208208
[psd].[AgentId]
209209
FROM @iis_store_data [psd];
210210

Migration-Scripts/Legacy-IIS/UpgradeIISRevokedAndRootsToWinCert.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ BEGIN TRY
159159
@win_cert_store_type_id,
160160
[psd].[StoreApproved],
161161
0,
162-
''{"WinRm Protocol":"''+@winrm_protocol+''","WinRm Port":"''+CONVERT(NVARCHAR(10),@winrm_port)+''","spnwithport":"''+@spnwithport+''","ServerUsername":"''+CONVERT(NVARCHAR(36),NEWID())+''","ServerPassword":"''+CONVERT(NVARCHAR(36),NEWID())+''","ServerUseSsl":"true"}'',
162+
''{"WinRM Protocol":"''+@winrm_protocol+''","WinRM Port":"''+CONVERT(NVARCHAR(10),@winrm_port)+''","spnwithport":"''+@spnwithport+''","ServerUsername":"''+CONVERT(NVARCHAR(36),NEWID())+''","ServerPassword":"''+CONVERT(NVARCHAR(36),NEWID())+''","ServerUseSsl":"true"}'',
163163
[psd].[AgentId]
164164
FROM @iis_store_data [psd];'
165165

0 commit comments

Comments
 (0)