Sunday, March 29, 2009

K2 Lessons Learned

It's been well over a year since I have updated this blog... mainly due to neglect, but also due to the lack of any valuable information worth posting.

I have been busy in this space for the last year, K2 BlackPearl development is getting popular. It's fast becoming the buzz word. As such, I've been busy with K2 installs and upgrades.



Upgrading from version 0803 of K2 BlackPearl to version 0807/370 was a big step. This required a bit more foresight than I was told or thought.


  • Install the upgrade over the top of 0803 is easy. Follow the wizard steps and restart your machine. That's what I was told. But I know better now.

What you need to do:
If you have already created a Visual Studio 2005 project in version 0803 and are doing the upgrade in the middle of your development project be careful. You can never be too paranoid in my oponion. Place your project in a nice safe place outside your development machine (don't just rely on Source Control here).


Install version 0807 over the top of 0803. Forget about any updates or patches at this point. Get this upgrade right first. Make sure your project(s) all compile and build in version 0807 first. If you have SharePoint installed, make sure your upgrade on the SharePoint server worked successfully. Especially with the "K2 for SharePoint" page in Central Admin.


Visual Studio Project Issues:


What if your project didn't build. Mine didn't. Don't panic, as it's not as bad as it may seem at first. In version 0803, there were 3 hidden projects that were created under the .kprx project file. Some of you probably already know this.


K2 have now moved these projects to a local destination in your Documents and Settings -> Local Settings section. The reason for this is to allow you to compile your projects while they are in Source Control without your hidden projects permissions blocking them. This is due to those hidden projects being referenced locally, when it compiles the dll's in the hidden projects needed to be checked out to properly build.


Now what happens is that when you open a .kprx file from source control and build it, the file will check the local file system for the hidden projects (which have now been rolled up in to one project) and if they do not exist, they will create a fresh copy, if they do, it will replace it.


This is a big change from 0803 to 0807 if you have already created your projects in 0803 and are converting them. Not all your projects will like this change, especially if you are like me and have referenced your own dll's in your .kprx project. In my case, I had issues with the project properly finding the hidden project on its own. What I had to do was open my .kprx project, go to the references section: Manage Project References, remove the reference to the old Extender Projects altogether and rebuild. I then deleted the Extender Project folder that was created under my project in the file system as it is no longer needed (also another reason for keeping a backup on another server rather than relying on Source Control).


Database issues:


The other change was with the SQL Server permissions. The K2 account on SQL Server in most instances is going to be a db owner on the databases that it controls. In 0807, this is no longer enough. Especially when you are using SmartObjects in your workflow.


Strangely enough, you will be able to Insert new records easily enough, but whenever you try a GetList call, you'll receive a permissions issue. The reason is the new level of permissions required. The K2 account will need SQL Server "sysadmin" rights on some of the databases. I am not sure to which databases as I didn't have enough time to fully test this. But I'd imagine on the SmartBox, SmartFunctions and SmartBroker databases as a minimum.


The reason I was given was due to the new functionality given to SmartObjects. The database can now be placed on a separate database server than K2's databases. This permission level is required for the K2 service to access two SQL Servers across the domain.... I'm not a network or infrastructure person, so please forgive the level of detail here. I just know that if you don't have sysadmin rights on some of the database tables, you're in for a shock.


Back on track:


Once this has been corrected and your Visual Studio projects all build, you've ensured that SharePoint's K2 for SharePoint page is running properly, you can then do your 370 patch update safely. I didn't have any issues with this (make sure you run all your upgrades and patches with the K2 Service Account).

No comments: