Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Bezmundo 48 posts 139 karma points
    Nov 11, 2015 @ 10:37
    Bezmundo
    0

    Umbraco upgrade 4.11.5 to 7 via new upgrade procedure

    Been trying out the new upgrade method from Umbraco 4 to 7 via nuget. I have a fresh install of v7 in visual studio and before running the solution I've changed the connection string to point to the v4 database.

    It recognises it as an upgrade and lets me proceed with the upgrade. However it seems to be falling over every time:

    The database failed to upgrade. ERROR: The database configuration failed with the following message: 'FK_umbracoUser2app_umbracoUser' is not a constraint. Could not drop constraint. See previous errors. Please check log file for additional information (can be found in '/App_Data/Logs/UmbracoTraceLog.txt')
    

    I've checked the database and 'FKumbracoUser2appumbracoUser' is a constraint. I've tried dropping the value from the database to then run the upgrade but that causes the database to then be unusable which the requires a restore.

    Heres where the code falls over in the error log:

    2015-11-11 10:27:49,905 [P9504/D2/T12] INFO Umbraco.Core.Persistence.Migrations.MigrationRunner - Executing sql statement 1: ALTER TABLE [umbracoUser2app] DROP CONSTRAINT [FKumbracoUser2appumbracoUser]

    2015-11-11 10:27:49,952 [P9504/D2/T12] INFO Umbraco.Core.Persistence.Migrations.MigrationRunner - Executing sql statement 2: sp_rename 'cmsTab', 'cmsPropertyTypeGroup'

    2015-11-11 10:27:50,139 [P9504/D2/T12] INFO Umbraco.Core.Persistence.Migrations.MigrationRunner - Executing sql statement 3: ALTER TABLE [cmsPropertyTypeGroup] ADD [parentGroupId] INTEGER NULL

    2015-11-11 10:27:50,202 [P9504/D2/T12] INFO Umbraco.Core.Persistence.Migrations.MigrationRunner - Executing sql statement 4: ALTER TABLE [cmsPropertyTypeGroup] ADD CONSTRAINT [FKcmsPropertyTypeGroupcmsPropertyTypeGroup_id] FOREIGN KEY ([parentGroupId]) REFERENCES [cmsPropertyTypeGroup] ([id])

    2015-11-11 10:27:50,264 [P9504/D2/T12] INFO Umbraco.Core.Persistence.Migrations.MigrationRunner - Executing sql statement 5: ALTER TABLE [cmsContentType] ADD [isContainer] BIT NOT NULL CONSTRAINT [DFcmsContentTypeisContainer] DEFAULT ('0')

    2015-11-11 10:27:50,311 [P9504/D2/T12] INFO Umbraco.Core.Persistence.Migrations.MigrationRunner - Executing sql statement 6: ALTER TABLE [cmsContentType] ADD [allowAtRoot] BIT NOT NULL CONSTRAINT [DFcmsContentTypeallowAtRoot] DEFAULT ('0')

    2015-11-11 10:27:50,374 [P9504/D2/T12] INFO Umbraco.Core.Persistence.Migrations.MigrationRunner - Executing sql statement 7: ALTER TABLE [cmsContentTypeAllowedContentType] ADD [sortOrder] INTEGER NOT NULL CONSTRAINT [DFcmsContentTypeAllowedContentTypesortOrder] DEFAULT ('1')

    2015-11-11 10:27:50,405 [P9504/D2/T12] INFO Umbraco.Core.Persistence.Migrations.MigrationRunner - Executing sql statement 8: CREATE TABLE [cmsContentType2ContentType] ([parentContentTypeId] INTEGER NOT NULL, [childContentTypeId] INTEGER NOT NULL)

    2015-11-11 10:27:50,436 [P9504/D2/T12] INFO Umbraco.Core.Persistence.Migrations.MigrationRunner - Executing sql statement 9: ALTER TABLE [cmsContentType2ContentType] ADD CONSTRAINT [PK_cmsContentType2ContentType] PRIMARY KEY CLUSTERED ([parentContentTypeId], [childContentTypeId])

    2015-11-11 10:27:50,483 [P9504/D2/T12] INFO Umbraco.Core.Persistence.Migrations.MigrationRunner - Executing sql statement 10: INSERT INTO cmsContentType2ContentType (parentContentTypeId, childContentTypeId) SELECT masterContentType, nodeId FROM cmsContentType WHERE not masterContentType is null and masterContentType != 0

    2015-11-11 10:27:50,514 [P9504/D2/T12] INFO Umbraco.Core.Persistence.Migrations.MigrationRunner - Executing sql statement 11: ALTER TABLE [cmsContentType] DROP CONSTRAINT [DFcmsContentTypemasterContentType]

    2015-11-11 10:27:50,561 [P9504/D2/T12] INFO Umbraco.Core.Persistence.Migrations.MigrationRunner - Executing sql statement 12: ALTER TABLE [cmsContentType] DROP COLUMN [masterContentType]

    2015-11-11 10:27:50,593 [P9504/D2/T12] INFO Umbraco.Core.Persistence.Migrations.MigrationRunner - Executing sql statement 16: sp_rename 'cmsPropertyType.tabId', 'propertyTypeGroupId', 'COLUMN'

    2015-11-11 10:27:50,639 [P9504/D2/T12] INFO Umbraco.Core.Persistence.Migrations.MigrationRunner - Executing sql statement 20: ALTER TABLE [cmsContentVersion] ADD [LanguageLocale] NVARCHAR(10) NULL

    2015-11-11 10:27:50,671 [P9504/D2/T12] INFO Umbraco.Core.Persistence.Migrations.MigrationRunner - Executing sql statement 21: DROP TABLE [umbracoAppTree]

    2015-11-11 10:27:50,749 [P9504/D2/T12] INFO Umbraco.Core.Persistence.Migrations.MigrationRunner - Executing sql statement 22: ALTER TABLE [umbracoUser2app] DROP CONSTRAINT [FKumbracoUser2appumbracoUser]

    It seems to be trying to drop the constraint twice? Any help on this would be greatly appreciated.

  • Otto 9 posts 78 karma points
    Nov 11, 2015 @ 15:01
    Otto
    0

    Are you directly trying to upgrade from 4.11.x ? I think you won't to able to do it at the moment I'm in the same process I started in 4.8 and now it's working in 6.0.0, (has been really heavy) but to upgrade v7 is being impossible.

    You can try that for your problem:

    ALTER TABLE [dbo].[cmsMacroProperty] drop CONSTRAINT [DF_macroProperty_macroPropertyHidden]
    
    GO 
    
    ALTER TABLE [dbo].[cmsMacroProperty] ADD  CONSTRAINT [DF_cmsMacroProperty_macroPropertyHidden]  DEFAULT ('0') FOR [macroPropertyHidden]
    
    GO
    
    
    
    Fix 2
    
    ALTER TABLE [dbo].[cmsMacroProperty]  WITH CHECK ADD  CONSTRAINT [FK_cmsMacroProperty_cmsMacroPropertyType_id] FOREIGN KEY([macroPropertyType])
    
    REFERENCES [dbo].[cmsMacroPropertyType] ([id])
    
    GO
    
    ALTER TABLE [dbo].[cmsMacroProperty] CHECK CONSTRAINT [FK_cmsMacroProperty_cmsMacroPropertyType_id]
    
    GO
    
    
    
    
    ALTER TABLE [dbo].[cmsMacroProperty] DROP CONSTRAINT [FK_umbracoMacroProperty_umbracoMacroPropertyType]
    
    GO
    
    
    
    ALTER TABLE [dbo].[cmsTagRelationship]  WITH CHECK ADD CONSTRAINT [FK_cmsTagRelationship_umbracoNode_id] FOREIGN KEY([nodeId])
    
    REFERENCES [dbo].[umbracoNode] ([id])
    
    GO
    
    ALTER TABLE [dbo].[cmsTagRelationship] CHECK CONSTRAINT [FK_cmsTagRelationship_umbracoNode_id]
    
    GO
    

    Regards

  • jonok 297 posts 658 karma points
    Dec 06, 2015 @ 23:52
    jonok
    0

    Hey Otto - It is very quick and easy to go straight from V4 to V7 - I followed this blog post and I couldn't believe how easy it was... http://www.attackmonkey.co.uk/blog/2015/10/upgrading-to-73

  • jonok 297 posts 658 karma points
    Dec 06, 2015 @ 23:50
    jonok
    0

    I got around this error (and successfully upgraded from 4.11.3 straight to 7.3.3) by running this sql script on the database before loading the upgraded site:

    IF EXISTS (SELECT * FROM sysobjects WHERE name = 'FK_umbracoUser2app_umbracoUser')
    BEGIN
      ALTER TABLE umbracoUser2app
      DROP CONSTRAINT FK_umbracoUser2app_umbracoUser
    END;
    
  • Bijesh Tank 192 posts 420 karma points
    Dec 07, 2015 @ 10:20
    Bijesh Tank
    0

    For reference, this blog post was also useful when I did an upgrade

  • jonok 297 posts 658 karma points
    Dec 07, 2015 @ 22:59
    jonok
    0

    Hi Bijesh - that sort of upgrade path isn't required any more. The 7.3 installer does it all automatically. I didn't believe it until I gave it a go.

Please Sign in or register to post replies

Write your reply to:

Draft