Symptoms
Error upgrading from 4.6.4 to 4.6.8
Diagnoses
Received a database error when upgrading. Configuration wizard says to call K2 support. Please call me at
Resolution
While investigating the error and looking at the database supplied we found that the constraint names were incorrect in the
[K2server].[EnvironmentServices].[SettingValue] DB. Once those constraints were renamed the installation was able to proceed without issue. It was tested twice to make sure once the constraints were fixed the 2nd errors seen were not there and we could not reproduce those errors after a successful install.
1. remove the existing constraints in the [K2server].[EnvironmentServices].[SettingValue] DB either with the SQL commands below or you can manually remove the constraints.
-- Remove the incorrectly named Constraints in the EnvironmentServices.SettingValue table
ALTER TABLE [EnvironmentServices].[SettingValue] DROP CONSTRAINT [DF__SettingVa__Binar__35DCF99B]
ALTER TABLE [EnvironmentServices].[SettingValue] DROP CONSTRAINT [DF__SettingVa__Boole__2C538F61]
ALTER TABLE [EnvironmentServices].[SettingValue] DROP CONSTRAINT [DF__SettingVa__DateT__33F4B129]
ALTER TABLE [EnvironmentServices].[SettingValue] DROP CONSTRAINT [DF__SettingVa__Decim__33008CF0]
ALTER TABLE [EnvironmentServices].[SettingValue] DROP CONSTRAINT [DF__SettingVa__Doubl__320C68B7]
ALTER TABLE [EnvironmentServices].[SettingValue] DROP CONSTRAINT [DF__SettingVa__Int16__2E3BD7D3]
ALTER TABLE [EnvironmentServices].[SettingValue] DROP CONSTRAINT [DF__SettingVa__Int32__2F2FFC0C]
ALTER TABLE [EnvironmentServices].[SettingValue] DROP CONSTRAINT [DF__SettingVa__Int64__30242045]
ALTER TABLE [EnvironmentServices].[SettingValue] DROP CONSTRAINT [DF__SettingVa__Singl__3118447E]
ALTER TABLE [EnvironmentServices].[SettingValue] DROP CONSTRAINT [DF__SettingVa__Strin__2B5F6B28]
ALTER TABLE [EnvironmentServices].[SettingValue] DROP CONSTRAINT [DF__SettingVa__Times__34E8D562]
ALTER TABLE [EnvironmentServices].[SettingValue] DROP CONSTRAINT [DF__SettingVa__Uniqu__2A6B46EF]
ALTER TABLE [EnvironmentServices].[SettingValue] DROP CONSTRAINT [DF__SettingVal__Byte__2D47B39A]
2. add the correctly named constraints to the [K2server].[EnvironmentServices].[SettingValue] DB
-- Add the missing Constraints in the EnvironmentServices.SettingValue table
ALTER TABLE [EnvironmentServices].[SettingValue] ADD CONSTRAINT [DF_EnvironmentServices_SettingValue_Binary] DEFAULT (NULL) FOR [Binary]
ALTER TABLE [EnvironmentServices].[SettingValue] ADD CONSTRAINT [DF_EnvironmentServices_SettingValue_Boolean] DEFAULT (NULL) FOR [Boolean]
ALTER TABLE [EnvironmentServices].[SettingValue] ADD CONSTRAINT [DF_EnvironmentServices_SettingValue_Byte] DEFAULT (NULL) FOR [Byte]
ALTER TABLE [EnvironmentServices].[SettingValue] ADD CONSTRAINT [DF_EnvironmentServices_SettingValue_DateTime] DEFAULT (NULL) FOR [DateTime]
ALTER TABLE [EnvironmentServices].[SettingValue] ADD CONSTRAINT [DF_EnvironmentServices_SettingValue_Decimal] DEFAULT (NULL) FOR [Decimal]
ALTER TABLE [EnvironmentServices].[SettingValue] ADD CONSTRAINT [DF_EnvironmentServices_SettingValue_Double] DEFAULT (NULL) FOR [Double]
ALTER TABLE [EnvironmentServices].[SettingValue] ADD CONSTRAINT [DF_EnvironmentServices_SettingValue_Int16] DEFAULT (NULL) FOR [Int16]
ALTER TABLE [EnvironmentServices].[SettingValue] ADD CONSTRAINT [DF_EnvironmentServices_SettingValue_Int32] DEFAULT (NULL) FOR [Int32]
ALTER TABLE [EnvironmentServices].[SettingValue] ADD CONSTRAINT [DF_EnvironmentServices_SettingValue_Int64] DEFAULT (NULL) FOR [Int64]
ALTER TABLE [EnvironmentServices].[SettingValue] ADD CONSTRAINT [DF_EnvironmentServices_SettingValue_String] DEFAULT (NULL) FOR [String]
ALTER TABLE [EnvironmentServices].[SettingValue] ADD CONSTRAINT [DF_EnvironmentServices_SettingValue_Single] DEFAULT (NULL) FOR [Single]
ALTER TABLE [EnvironmentServices].[SettingValue] ADD CONSTRAINT [DF_EnvironmentServices_SettingValue_Timespan] DEFAULT (NULL) FOR [Timespan]
ALTER TABLE [EnvironmentServices].[SettingValue] ADD CONSTRAINT [DF_EnvironmentServices_SettingValue_UniqueIdentifier] DEFAULT (NULL) FOR [UniqueIdentifier]
Once the constraints are renamed you can preform the upgrade if any additional errors occur please let us know.