Encryption validation error when upgrading to K2 5.6
When upgrading to K2 5.6, you may run into an Encryption Validation error that stops the upgrade and puts it in a 'Recover' stage:
However, after the K2 database was migrated, the following script was already completed to drop and re-add encryption:
OPEN MASTER KEY DECRYPTION BY PASSWORD = 'passwordhere';
ALTER MASTER KEY DROP ENCRYPTION BY SERVICE MASTER KEY;
ALTER MASTER KEY ADD ENCRYPTION BY SERVICE MASTER KEY;
CLOSE MASTER KEY;
And the following does show that data is property decrypted:
OPEN SYMMETRIC KEY SCSSOKey
DECRYPTION BY CERTIFICATE SCHostServerCert;
SELECT [VariableToken],
CONVERT(nvarchar(max), DECRYPTBYKEY([VariableValue])) as 'Decrypted Value',
[VariableValue]
FROM [HostServer].[Configuration]
WHERE [Encrypted]=1
The issue was due to the [K2HOSTCONNECTIONSTRING_SYSTEM] row in the HostServer.Configuration table not being encrypted, but the [Encrypted] column was set to 1.
To resolve you can run:
UPDATE [HostServer].[Configuration]
SET [Encrypted] = 0
WHERE [VariableToken] = '[K2HOSTCONNECTIONSTRING_SYSTEM]'
And then re-run the Setup Manager and perform the 'Recover' option. Once the upgrade is completed, this row should be properly encrypted again.


Comments
Post a Comment