locked
Upgrade CRM 2011 RC Organization to RTM RRS feed

  • Question

  • Hi,

    I have tried to upgrade my CRM 2011 RC Installation to RTM. But It didn't work.

    First I tried an Implace Upgrade with by Installing the Patch KB2461082 with the following result:
    "The Update for Microsoft Dynamics CRM Server (KB2461082) completed successfully. However, the database update failed for some organizations. "

    In the Logfile the following Details where shown:

    11:27:43|   Info| Database update install failed for orgId = 24291934-5f96-49ff-8f28-9440ce1635d6.  Continuing with other orgs.  Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: Violation of UNIQUE KEY constraint 'UQ_LocalizedLabelCheck'. Cannot insert duplicate key in object 'MetadataSchema.LocalizedLabel'.
    Violation of UNIQUE KEY constraint 'UQ_LocalizedLabelCheck'. Cannot insert duplicate key in object 'MetadataSchema.LocalizedLabel'.
    Violation of UNIQUE KEY constraint 'UQ_LocalizedLabelCheck'. Cannot insert duplicate key in object 'MetadataSchema.LocalizedLabel'.

    11:27:54|   Info| View the log file for more information. To update each organization manually, use Deployment Manager.

    On the next step I tried to import the organisation into the upgrade RCM Installation, with the same error message:

    15:26:39|   Info| Updating language packs
    15:26:39|   Info| automaticallyInstallDatabaseUpdates = True
    15:26:39|   Info| Applying database updates
    15:26:39|   Info| Applying database updates to the organization...
    15:26:40|  Error| Applying database updates to organization with name = InfomanAG Id=24291934-5f96-49ff-8f28-9440ce1635d6 failed with Exception:
    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: Violation of UNIQUE KEY constraint 'UQ_LocalizedLabelCheck'. Cannot insert duplicate key in object 'MetadataSchema.LocalizedLabel'.
    Violation of UNIQUE KEY constraint 'UQ_LocalizedLabelCheck'. Cannot insert duplicate key in object 'MetadataSchema.LocalizedLabel'.
    Violation of UNIQUE KEY constraint 'UQ_LocalizedLabelCheck'. Cannot insert duplicate key in object 'MetadataSchema.LocalizedLabel'.
    The statement has been terminated.

    I haved executed the SQL Script which is listed in KB article  "delete from UserQueryBase... " prior the organization import, -> result: (0 row(s) affected)

    The Same error is listed on: http://social.microsoft.com/Forums/eu/crm2011beta/thread/25997e87-a8c4-4dea-9dce-f6257049d607

    Thanks for any hints

    Matthias

     

     


     

     

    Thursday, March 17, 2011 3:07 PM

Answers

All replies

  • Wednesday, March 23, 2011 5:28 PM
  • Hi Matthias,

    I experience a similar problem going from RC to RTM. I traced what happened on the database and found out that it tried to add a row to the Metadataschame.LocalizedLabel table that already existed (duh, that's what the error told you too :) ). Apparently it has something to do with a fix on the exchangerate attribute on a few entities. Although it was referenced multiple times in the upgrade script, in my case, I was able to successfully run the upgrade by removing those records first. The following script should did the trick for me. As always: make sure to backup your database first :)

    declare @organizationBaseLanguage int
    select @organizationBaseLanguage = LanguageCode from OrganizationBase
    declare @systemSolutionId uniqueidentifier
    SELECT @systemSolutionId = SolutionID FROM SolutionBase WHERE UniqueName='System'

     exec sp_executesql N'DELETE FROM MetadataSchema.LocalizedLabel where ObjectId = ''6d36e3a6-3e08-4fbc-aaa7-247eba2ab9f5'' and ObjectColumnName = N''DisplayName'' and LanguageId = @organizationBaseLanguageValue and SolutionId = ''FD140AAD-4DF4-11DD-BD17-0019B9312238''',
      N'@LocalizedLabelId uniqueidentifier,@ObjectId uniqueidentifier,@ObjectColumnName nvarchar(11),@LabelTypeCode int,@ComponentState int,@SolutionId uniqueidentifier,@OverwriteTime datetime,@IsManaged bit,@organizationBaseLanguageValue int',
      @LocalizedLabelId='5191FD7A-3BE1-499A-8F71-ED044741C627',
      @ObjectId='BE8D9D86-165A-4F11-926D-3358AF967CB5',
      @ObjectColumnName=N'DisplayName',
      @LabelTypeCode=1,
      @ComponentState=0,
      @SolutionId=@systemSolutionId,
      @OverwriteTime='1900-01-01 00:00:00',
      @IsManaged=1,
      @organizationBaseLanguageValue=@organizationBaseLanguage
     
    exec sp_executesql N'DELETE FROM MetadataSchema.LocalizedLabel where ObjectId = ''5c346e62-9f48-4250-a58c-53a22200657f'' and ObjectColumnName = N''DisplayName'' and LanguageId = @organizationBaseLanguageValue and SolutionId = ''FD140AAD-4DF4-11DD-BD17-0019B9312238''',
      N'@LocalizedLabelId uniqueidentifier,@ObjectId uniqueidentifier,@ObjectColumnName nvarchar(11),@LabelTypeCode int,@ComponentState int,@SolutionId uniqueidentifier,@OverwriteTime datetime,@IsManaged bit,@organizationBaseLanguageValue int',
      @LocalizedLabelId='4768829E-9570-45AB-9F54-A920CF663420',
      @ObjectId='59B43791-D3DD-4D87-89E5-1E86AC523319',
      @ObjectColumnName=N'DisplayName',
      @OverwriteTime='1900-01-01 00:00:00',
      @LabelTypeCode=1,
      @ComponentState=0,
      @SolutionId=@systemSolutionId,
      @IsManaged=1,
      @organizationBaseLanguageValue=@organizationBaseLanguage

    Note that the above script might not be complete for you organization (as said there were a couple more conditional inserts on LocalizedLabel (if MUI pack installed, if ...)): I just added those lines that were required to fix my install and I guess that in most cases these will solve other organizations too. However, if you still receive the same error, I am prepared to provide a more complete script or you can figure it out yourself by running a trace on SQL Server during the upgrade. 

    Good luck! :)

    Wim

    Wednesday, March 30, 2011 1:53 PM
  • thanks for the answers.

    I have migrated the organization by importing it in a new crm 2011 RTM installation with UR1.

    After Importing, I have to run the database scripts in the crm deployment manager.

    Organization -> Update Database

     

    regards

    Matthias

    • Marked as answer by Matthias Back Wednesday, April 27, 2011 6:19 PM
    Wednesday, April 27, 2011 6:19 PM
  • Hi,I have the same issue in CRM 2011 with Rollup 15. For months on end everything worked ok; but now when I publish the customizations I get this error.

    I used your script to trace the record in the database and found and deleted it. However, the issue still persists; possibly because it is still in other tables somewhere. I cannot access the link you provided in the above article.

    Can you give me more information of where to look for further configuration?

    Thanks

    Philippe


    it's all very nice when it works

    Thursday, February 13, 2014 11:31 AM