Copied to clipboard

Flag this post as spam?

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


  • Sowndar M 50 posts 124 karma points
    Feb 16, 2024 @ 13:59
    Sowndar M
    0

    Facing issue with Upgrade from Umbraco 8.0.1 to 8.18.13

    We are facing an issue with upgrading from Umbraco 8.0.1 to 8.18.13

    Once we update the package from Nuget, it shows the following error:

    The database failed to upgrade. ERROR: The database configuration failed with the following message: Invalid column name 'preventCleanup'. Please check log file for additional information (can be found in '/App_Data/Logs/')

    enter image description here

    I have run the below query on SQL . No table have this column name

    SELECT TABLE_NAME 
    FROM INFORMATION_SCHEMA.COLUMNS 
    WHERE COLUMN_NAME = 'preventCleanup';
    

    Log Error

    "System.Data.SqlClient.SqlException (0x80131904): Invalid column name 'preventCleanup'.\r\n   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)\r\n   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)\r\n   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)\r\n   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()\r\n   at System.Data.SqlClient.SqlDataReader.get_MetaData()\r\n   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)\r\n   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)\r\n   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)\r\n   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)\r\n   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)\r\n   at Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func) in D:\\a\\1\\s\\src\\Umbraco.Core\\Persistence\\FaultHandling\\RetryPolicy.cs:line 172\r\n   at NPoco.Database.ExecuteReaderHelper(DbCommand cmd)\r\n   at NPoco.Database.ExecuteDataReader(DbCommand cmd)\r\n   at NPoco.Database.<QueryImp>d__164`1.MoveNext()\r\nClientConnectionId:9e01f315-fd74-4731-b370-bee004cde492\r\nError Number:207,State:1,Class:16","InstanceId":"2a79313c","SourceContext":"Umbraco.Core.Persistence.UmbracoDatabase"
    
  • Owain Jones 55 posts 384 karma points MVP 3x c-trib
    Feb 16, 2024 @ 17:15
    Owain Jones
    0

    Hi Sowndar,

    There are a bunch of breaking changes between v8.0.0 and v8.1.0, therefore I would recommend following the steps in the documentation and upgrade to 8.1.0 first, before trying to upgrade to 8.18.13

    https://docs.umbraco.com/umbraco-cms/fundamentals/setup/upgrading/version-specific#id-8.0.0-to-8.1.0

  • Sowndar M 50 posts 124 karma points
    Feb 16, 2024 @ 19:16
    Sowndar M
    0

    @owain Jones

    Thank you for your reply.

    We tested that as well. Initially, when we upgraded to version 8.1, everything was working fine. However, after moving to the subsequent version, the same error began to occur.

    We have two websites using the same version. We make the same changes to both sites as we did on the first website. However, only one site shows an error, while the other does not.

  • Sowndar M 50 posts 124 karma points
    Feb 16, 2024 @ 19:25
    Sowndar M
    1

    I'm not entirely sure if this is the correct way to resolve the issue.

    Based on the error ("Invalid column name") and comparing it with my other upgraded site, I began by creating the missing column in the table.

    After doing so, it started working.

    SET ANSI_NULLS ON
        GO
    
        SET QUOTED_IDENTIFIER ON
        GO
    
    CREATE TABLE [dbo].[umbracoContentVersionCleanupPolicy](
        [contentTypeId] [int] NOT NULL,
        [preventCleanup] [bit] NOT NULL,
        [keepAllVersionsNewerThanDays] [int] NULL,
        [keepLatestVersionPerDayForDays] [int] NULL,
        [updated] [datetime] NOT NULL
    ) ON [PRIMARY]
    GO
    
    ALTER TABLE [dbo].[umbracoContentVersionCleanupPolicy]  WITH NOCHECK ADD  CONSTRAINT [FK_umbracoContentVersionCleanupPolicy_cmsContentType_nodeId] CHECK  (([contentTypeId]<>''))
    GO
    
    ALTER TABLE [dbo].[umbracoContentVersionCleanupPolicy] CHECK CONSTRAINT [FK_umbracoContentVersionCleanupPolicy_cmsContentType_nodeId]
    GO
    SELECT TABLE_NAME 
    FROM INFORMATION_SCHEMA.COLUMNS 
    WHERE COLUMN_NAME = 'preventCleanup';
    
    ALTER TABLE [dbo].[umbracoContentVersion]
    ADD preventCleanup bit NOT NULL DEFAULT 0;
    
    SELECT TABLE_NAME 
    FROM INFORMATION_SCHEMA.COLUMNS 
    WHERE COLUMN_NAME = 'alias';
    
    ALTER TABLE [cmsPropertyTypeGroup]
    ADD [type] BIT NOT NULL DEFAULT 0;
    ALTER TABLE [cmsPropertyTypeGroup]
    ADD [alias] NVARCHAR(255) NULL;
    
    SELECT TABLE_NAME 
    FROM INFORMATION_SCHEMA.COLUMNS 
    WHERE COLUMN_NAME = 'labelOnTop';
    
    
    ALTER TABLE [dbo].[cmsPropertyType]
    ADD
        mandatoryMessage nvarchar(500) NULL,
        validationRegExpMessage nvarchar(500) NULL;
    
    ALTER TABLE [dbo].[cmsPropertyType]
    ADD labelOnTop bit NOT NULL DEFAULT 0;
    
  • Owain Jones 55 posts 384 karma points MVP 3x c-trib
    Feb 19, 2024 @ 11:47
    Owain Jones
    0

    Hi Sowndar,

    Glad to hear that you got it working! 😄

    Also, in case you're interested, I just had a look through Umbraco 8's database migrations; and I can see that the preventCleanup column was supposed to be added by the v8.18.0 migration: https://github.com/umbraco/Umbraco-CMS/blob/v8/dev/src/Umbraco.Core/Migrations/Upgrade/V818_0/AddContentVersionCleanupFeature.cs

    Strange why it didn't work for you.

Please Sign in or register to post replies

Write your reply to:

Draft