Symptoms
Issue during upgrade from K2 4.6.11 to 4.7 - upgrade process fails with the following errors were logged: Script execute failed: System.Exception: Script execution exception:
Microsoft.SqlServer.Management.Common.ExecutionFailureException: An exception occurred while executing a Transact-SQL statement or batch. ---> System.Data.SqlClient.SqlException: There is already an object named 'GetIdentityPropertyValue' in the database. Group run failed with exception: System.Exception: Target failed to execute: APPIT_1.4 (4.12060.1690.0) Consolidated SourceCode.Data.Identity.DiffScript.sql Target did not complete successfully: BP APPIT_1.4 Scripts Script execute failed: System.Exception: Script execution exception: Microsoft.SqlServer.Management.Common.ExecutionFailureException: An exception occurred while executing a Transact-SQL statement or batch. ---> System.Data.SqlClient.SqlException: Invalid column name 'DisplayName'. Group run failed with exception: System.Exception: Target failed to execute: SourceCode.Data.CustomUM diff script from Appit 1.4 Target did not complete successfully: BP 4.16060.7.5 Scripts Script execute failed: System.Exception: Script execution exception: Microsoft.SqlServer.Management.Common.ExecutionFailureException: An exception occurred while executing a Transact-SQL statement or batch. ---> System.Data.SqlClient.SqlException: Invalid column name 'DisplayName'. Group run failed with exception: System.Exception: Target failed to execute: SourceCode.Data.Server.4.16060.7.5.PostUpgrade.sql Target did not complete successfully: Server and Serverlog post deploy for 4.16060.7.5 Script execute failed: System.Exception: Script execution exception: Microsoft.SqlServer.Management.Common.ExecutionFailureException: An exception occurred while executing a Transact-SQL statement or batch. ---> System.Data.SqlClient.SqlException: Invalid column name 'DisplayName_XML'.
Diagnoses
This issue may occur if 4.6.11 environment had the coldfix with internal ID 611518 applied which adds Email column and GetIdentityPropertyValue function to Identity table in K2 DB. When this coldfix is installed you have to execute the following script before running upgrade to 4.7:
USE K2
BEGIN
ALTER TABLE >K2].RIdentity].]Identity]
DROP COLUMN Email
DROP FUNCTION >Identity].IGetIdentityPropertyValue]
END
This coldfix is already included in 4.7 release OOB. These table and column created with coldfix installation in K2 4.6.11 have to be dropped before attempting upgrade to 4.7. Future (post 4.7) versions of K2 installer should implement better handling of these existing SQL objects.
Resolution
After dropping column and function you should be able to complete upgrade process without errors.