Sunday, 26 October 2008

Problem upgrading to 0807 with non-default K2 database names

If you are upgrading from 0803 to 0807 (4.8210.2.0) and you have non-default K2 databases names, then you may well experience the same problem we did over the weekend! During the initial installation of K2 [blackpearl] (0803) we decided to change the default database names by prefixing "K2_" to each database (so that they would be logically grouped together). Unfortunately there are hardcoded references to the Categories database in one of the update sql scripts for 0807 (4.8210.2.0) which causes the Configuration Manager to complete unsuccessfully. We have raised the issue with K2 however I thought it only fair to document the problem here and provide you with a safe workaround!

Problem

During the upgrade to 0807 (4.8210.2.0) the Configuration Manager will complete with errors because the K2 Databases will not be fully updated (see Incomplete status below):-

When consulting the configuration log file, we found that the WorkspaceAlter.sql script contained hardcoded references to the Categories database. Because our categories database was actually named K2_Categories, it could not be updated. Funnily, the error we actually received was as follows:-

"217","2008-10-25 09:25:13","Error","15","15002","ERROR","SourceCode.Database.Configuration.ConfigureDBs","15002 Database 'Categories' cannot be opened because it is offline.

This was because we did indeed have an offline database called Categories. This was a side-effect from a previous attempt to upgrade to 0807 using the 4.8210.1.1 release (We had manually taken this database offline and it was earmarked for deletion). I am guessing that if we didn't have this offline database, we would have received something more along the lines of "Invalid object name 'Categories.dbo.Categories', although I cannot say for certain.

The Workaround

To workaround this problem, we stopped the Configuaration Manager, located the WorkspaceAlter.sql file (within C:\Program Files\K2 BlackPearl\Configuration\Scripts), corrected all hardcoded references from Categories to K2_Categories (our name for the Categories database), then re-ran the Configuration Manager. All tasks now completed successfully (and in the correct order).

Hope this helps.

No comments: