SF 4.4 to 5.0 upgrade error - Bugs & Issues - Bugs & Issues - Progress Community
 Bugs & Issues

SF 4.4 to 5.0 upgrade error

  • I've been able to upgrade my sitefinity website from 4.4 to 5.0
    I've followed Richard instructions, so I have'nt changed web.config file, and the web site is working.
    Anybody nows what is the correct web.config configuration?

    Thanks
  • Hello Nana,

    The error you get is somehow strange as it appears that the system tries to insert a duplicate object with that name in the database. Can you tell us how did you proceed with upgrading your project? Any specific information that might help us get a better picture of the situation.

    Regards,
    Victor Velev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  • I followed exact instructions on documentation. The only thing I did different was to put the httpmodules in the exact same order as specified by
    http://www.sitefinity.com/documentation/documentationarticles/switching-to-claims-based-authentication

    I have opened a support ticket. thanks
  • Same here!
    The There is already an object named 'sf_libraries' in the database.
     Exception during the 4.4 migration to 5.0 happends when the upgrade script tries to sync the database.

    Can anyone from Telerik support team address this issue?
  • I have the exact same error as Nana. I too followed the instructions in the documentation.
  • Hi,

    If you are upgrading your site from previous versions of Sitefinity, you may need to add few sections of code to the webconfig, as explained in our documentation. Please note that you need to add those sections, after you have copied the dlls / or hit the upgrade button / but before restarting the project solution. We do not provide the webconfig changes, as we assume that you want to stay with the forms authentication method, instead of switching to claims authentication.

    Greetings,
    Victor Velev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  • That's true.
    If you follow the documentation instructions, you get the web.config error.
  • Victor, thanks for your reply. I think there are two Sitefinity problems here.

    First is that the documentation does NOT clearly state that you should ONLY add the Claims code IF you plan to use Claims Authentication.

    Here's what your Upgrade Instructions say
    "After the project manager upgrades your project you must merge your project’s web.config file with changes in the web.config file for the version of Sitefinity you are upgrading to. 
    In Sitefinity 5.0 there are introductions for Claims authentication. There are introductions in system.web/httpModules and system.webServer/modules configuration sections. Modify these sections, so that they have the new introductions as below:" - Where does it say do not include this if you want to continue to use Forms Authentication.

    The Second Problem is that if you are planning on using Claims Authentication there are a number of other lines in Web.Config that appear to be required (based on my BLANK 5.0 Project Web.config) which ARE NOT written to the Upgraded Web.config when it is converted and your Upgrade instructions don't include adding those lines into Web.config. So I don't see how it is possible to get an Upgraded 4.4 site to work properly with Claims Authentication without all the proper lines being in Web.config.

    I've looked at all the documentation carefully and it appears that you can switch back and forth between Forms and Claims Authentication from the Admin Panel so I presumed that all of the Claims authentication lines had to be added regardless of which you were using. If you look at
    http://www.sitefinity.com/documentation/documentationarticles/switching-to-claims-based-authentication
    It explains how to change from the Admin backend and how additional lines (that aren't listed in the Upgrade section) have to be added to Web.config.

    Then if you look at Switching to Forms Authentication at
    http://www.sitefinity.com/documentation/documentationarticles/switching-to-forms-authentication

    It says you just make changes to the Admin Backend through a Dropdown list.

    I must say this is all very confusing and not well documented. Please give us clear instructions on what is needed in Web.config for FORMS authentication and for CLAIMS authentication.

    I think this is a good reason why Telerik should adopt a Beta program for major Sitefinity Releases so that end users can test this stuff out and provide feedback to the Development Team before the product is officially released. I would be happy to do testing as long as I know I am a Beta tester. I prefer not to end up testing a released product.

    Rick
  • My web.config definitely contains the sections the documentation required to be added and I was getting the error. That is why I posted here. 
  • Same problem as everyone else. I always create a Blank New Project when I upgrade to be able to compare files against my current version. From comparing the Blank Project Web.config to my 4.4 to 5.0 Upgraded Project Web.config there are lots on differences. It looks like the Upgrade from the Sitefinity Project Manager didn't properly correct the web.config. I'll try and list ALL the inconsistencies comparing section by section. You can see that the Upgrade DID NOT make lots of the changes shown in the Blank New Project. Of course, I have no idea which of these is causing the site not to load.

    BLANK
    <configuration>
      <configSections>
        <section requirePermission="false" name="microsoft.identityModel" type="Microsoft.IdentityModel.Configuration.MicrosoftIdentityModelSection, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


    CONVERTED
    <configuration>
      <configSections>
        <sectionGroup name="madam">
          <section requirePermission="false" name="formsAuthenticationDisposition" type="Telerik.Sitefinity.Utilities.MS.Madam.FormsAuthenticationDispositionSectionHandler, Telerik.Sitefinity.Utilities" />
          <section requirePermission="false" name="basicAuthentication" type="Telerik.Sitefinity.Utilities.MS.Madam.FormsAuthenticationDispositionSectionHandler, Telerik.Sitefinity.Utilities" />
          <section requirePermission="false" name="userSecurityAuthority" type="System.Configuration.SingleTagSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        </sectionGroup>

    BLANK
      <system.web>
        <httpRuntime maxRequestLength="102400" requestValidationType="Telerik.Sitefinity.Security.Claims.CustomRequestValidator, Telerik.Sitefinity" />

    CONVERTED
      <system.web>
         <httpRuntime maxRequestLength="102400" />

    BLANK
        <compilation debug="false" targetFramework="4.0">

    CONVERTED
        <compilation debug="false" defaultLanguage="c#" targetFramework="4.0">

    BLANK
       <authentication mode="None" />

    CONVERTED
       <authentication mode="Forms" />

    BLANK
    no AtomPubModule

    CONVERTED
          <add name="SitefinityAtompubModule" type="Telerik.Sitefinity.Security.SitefinityAtompubModule, Telerik.Sitefinity" />

    BLANK
      <system.webServer>
        <validation validateIntegratedModeConfiguration="false" />
        <modules runAllManagedModulesForAllRequests="true">
    no AtomPubModule
          <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />

    CONVERTED
      <system.webServer>
        <validation validateIntegratedModeConfiguration="false" />
        <modules runAllManagedModulesForAllRequests="true">
          <remove name="WebDAVModule" />
          <add name="SitefinityAtompubModule" type="Telerik.Sitefinity.Security.SitefinityAtompubModule, Telerik.Sitefinity" />

          <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />

    BLANK
    </system.webServer>
     <microsoft.identityModel>
        <service>
          <claimsAuthenticationManager type="Telerik.Sitefinity.Security.Claims.SFClaimsAuthenticationManager, Telerik.Sitefinity" />
          <securityTokenHandlers>
            <add type="Telerik.Sitefinity.Security.Claims.SWT.SWTSecurityTokenHandler, Telerik.Sitefinity" />
          </securityTokenHandlers>
          <audienceUris mode="Never"></audienceUris>
          <federatedAuthentication>
            <wsFederation passiveRedirectEnabled="true" issuer="http://localhost" realm="http://localhost" requireHttps="false" />
            <cookieHandler requireSsl="false" />
          </federatedAuthentication>
          <issuerNameRegistry type="Telerik.Sitefinity.Security.Claims.CustomIssuerNameRegistry, Telerik.Sitefinity">
            <trustedIssuers></trustedIssuers>
          </issuerNameRegistry>
          <issuerTokenResolver type="Telerik.Sitefinity.Security.Claims.SWT.WrapIssuerTokenResolver, Telerik.Sitefinity"/>
        </service>
      </microsoft.identityModel>

    CONVERTED
    </system.webServer>
     <madam>
        <userSecurityAuthority realm="Sitefinity" provider="Telerik.Sitefinity.Utilities.MS.Madam.FormsUserSecurityAuthority" exposeClearTextPassword="false " />
        <formsAuthenticationDisposition>
          <discriminators all="1">
            <!-- This discriminator helps detect redirection to the Forms login page. -->
            <discriminator inputExpression="Response.RedirectLocation" pattern="login.aspx\?returnurl\=" type="Telerik.Sitefinity.Utilities.MS.Madam.RegexDiscriminator" />
            <discriminator type="Telerik.Sitefinity.Utilities.MS.Madam.Discriminator" all="false">
              <discriminator inputExpression="Request.Url" pattern="atompub/.*" type="Telerik.Sitefinity.Utilities.MS.Madam.RegexDiscriminator" />
            </discriminator>
          </discriminators>
        </formsAuthenticationDisposition>
        <basicAuthentication>
          <discriminators all="1">
            <discriminator type="Telerik.Sitefinity.Utilities.MS.Madam.Discriminator" all="false">
              <discriminator inputExpression="Request.Url" pattern="atompub/.*" type="Telerik.Sitefinity.Utilities.MS.Madam.RegexDiscriminator" />
            </discriminator>
          </discriminators>
        </basicAuthentication>
      </madam>


  • I have a question though for those of you who were sucessful, did you follow the upgrade chain

    for example
    4.1 -> 4.2 --> 4.3-->4.4 --> 5.0   ?

    and for those of us with the SF libraries error
    did you upgrade from
    4.2 --> 4.4 --> 5.0?

    In order words, did you skip an upgrade version?
  • So can someone please help us with the SF_libraries error please.
  • I've gone back and compared my original unconverted 4.4 Web.config against the 5.0 Blank site Config to identify what new items show up from 5.0. I then went to my Converted 5.0 web.config, stripped out all of the Claims config items and my development site now loads properly.

    I think if the Upgrade Documentation can be changed to remove the Claims authenticate config items and instead instruct users that if they plan to use replace 4.4 Forms Authentication with 5.0 Claims Authentication that they should go to this page http://www.sitefinity.com/documentation/documentationarticles/switching-to-claims-based-authentication for instructions on how to update web.config and set up Claims authentication. That would prevent people from automatically merging this code when not necessary.
  • @Craig Brown, I ran into the same problem you did with the frontend working and the backend giving me the same error you posted. I replaced this portion in my web.config with the following from the empty project folder and it fixed the problem. I was missing the ClaimsPrincipalHttpModule module

    <modules runAllManagedModulesForAllRequests="true">
      <remove name="WebDAVModule" />
      <remove name="UrlRoutingModule" />
      <remove name="ScriptModule" />
      <remove name="RadUploadModule" />
      <remove name="Sitefinity" />
      <remove name="SitefinityAnalyticsModule" />
      <remove name="FormsAuthentication"/>
      <remove name="RoleManager"/>
      <add name="ClaimsPrincipalHttpModule" type="Microsoft.IdentityModel.Web.ClaimsPrincipalHttpModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      <add name="SitefinityClaimsAuthenticationModule" type="Telerik.Sitefinity.Security.Claims.SitefinityClaimsAuthenticationModule, Telerik.Sitefinity" />
      <add name="Sitefinity" type="Telerik.Sitefinity.Web.SitefinityHttpModule, Telerik.Sitefinity" />
      <add name="SessionAuthenticationModule" type="Telerik.Sitefinity.Security.Claims.SitefinitySessionAuthenticationModule, Telerik.Sitefinity" />
      <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule, Telerik.Web.UI" />
      <add name="SitefinityAnalyticsModule" type="Telerik.Sitefinity.Analytics.Server.DependencyResolution.Module.DependencyRegistrarHttpModule, Telerik.Sitefinity.Analytics.Server.DependencyResolution" />
    </modules>


  • Working now. Thank you.