Upgrading from version 4.0 to 4.1

   —   
In the past few weeks we have encountered many occurrences of one issue after upgrading to version 4.1. In this blog post I will describe the issue and also how to solve it.
The issue is mostly caused by not following the upgrade instructions, where is also mentioned that the web site should be offline in order to perform the upgrade.

The error message (shown below) is displayed after the user attempts to log into Sit Manager or CMS Desk:

[DataConnection.ExecuteQuery]: Query: UPDATE CMS_UserSettings SET [UserNickName] = @UserNickName, [UserPicture] = @UserPicture, [UserSignature] = @UserSignature, [UserURLReferrer] = @UserURLReferrer, [UserCampaign] = @UserCampaign, [UserMessagingNotificationEmail] = @UserMessagingNotificationEmail, [UserCustomData] = @UserCustomData, [UserRegistrationInfo] = @UserRegistrationInfo, [UserPreferences] = @UserPreferences, [UserActivationDate] = @UserActivationDate, [UserActivatedByUserID] = @UserActivatedByUserID, [UserTimeZoneID] = @UserTimeZoneID, [UserAvatarID] = @UserAvatarID, [UserBadgeID] = @UserBadgeID, [UserShowSplashScreen] = @UserShowSplashScreen, [UserActivityPoints] = @UserActivityPoints, [UserForumPosts] = @UserForumPosts, [UserBlogComments] = @UserBlogComments, [UserGender] = @UserGender, [UserDateOfBirth] = @UserDateOfBirth, [UserMessageBoardPosts] = @UserMessageBoardPosts, [UserSettingsUserGUID] = @UserSettingsUserGUID, [UserSettingsUserID] = @UserSettingsUserID, [WindowsLiveID] = @WindowsLiveID, [UserBlogPosts] = @UserBlogPosts, [UserWaitingForApproval] = @UserWaitingForApproval, [UserDialogsConfiguration] = @UserDialogsConfiguration, [UserDescription] = @UserDescription WHERE [UserSettingsID] = @UserSettingsID: caused exception: Must declare the scalar variable "@UserDialogsConfiguration".

Or you may get also very similar error message, like this:

INSERT INTO CMS_User ([UserName], [FirstName], [MiddleName], [LastName], [FullName], [Email], [UserPassword], [PreferredCultureCode], [PreferredUICultureCode], [UserEnabled], [UserIsEditor], [UserIsGlobalAdministrator], [UserIsExternal], [UserPasswordFormat], [UserCreated], [LastLogon], [UserStartingAliasPath], [UserGUID], [UserLastModified], [UserLastLogonInfo], [UserIsHidden], [UserVisibility], [UserIsDomain], [UserHasAllowedCultures] ) VALUES ( @UserName, @FirstName, @MiddleName, @LastName, @FullName, @Email, @UserPassword, @PreferredCultureCode, @PreferredUICultureCode, @UserEnabled, @UserIsEditor, @UserIsGlobalAdministrator, @UserIsExternal, @UserPasswordFormat, @UserCreated, @LastLogon, @UserStartingAliasPath, @UserGUID, @UserLastModified, @UserLastLogonInfo, @UserIsHidden, @UserVisibility, @UserIsDomain, @UserHasAllowedCultures); SELECT @@identity AS [UserID]: caused exception: Must declare the scalar variable "@UserIsDomain".

To solve this issue please follow the steps below and download appropriate package.

These packages:
- this package is for error with "@UserDialogsConfiguration
- and this package is for "@UserIsDomain” error

contain simple scripts in aspx page will refresh the ClassXMLSchema and regenerate default queries.
Please extract the files (both .aspx and .aspx.cs) to ~\CMSPages\ folder and visit (only once, don't reload/refresh the page!) following URL in your browser:

www.domain.com/CMSPages/updateUserSettingsTableSchema.aspx
or
www.domain.com/CMSPages/updateUserTableSchema.aspx


Please note that there will be no output/result message, mostly "XML parsing error" can appear. Please check if the queries were updated and you are able to log into the site. Now you can remove those two files from your CMSPages folder.

Update: The restart of the application is required in most cases after you have applied one of the packages from this post. You can invoke the restart by making a change in web.config file.

This article applies for upgrading to Kentico 6 as well.

Share this article on   LinkedIn

Juraj Ondrus

Hi, I am the Technical support leader at Kentico. I'm here to help you use Kentico and get as much as possible out of it.