Error upgrading from from 1.6.1 to RC2.0

Topics: ASP.NET 2.0
Dec 10, 2010 at 11:11 PM

I'm trying to convert my existing 1.6.1 blog to RC2.0; I downloaded the web.zip file and extracted that to a local folder and ran the page - that worked. So then I ran MSSQLUpgradeFrom1.6To2.0.sql, that reported everything was fine. I merged my customisations into the new web.config (elmah and flickr integration as well as SqlMembershipProvider... haven't got round to converting to DbMembershipProvider). However now I'm getting an error: "Invalid column name 'IsDeleted', looking at be_PostComment, be_Posts and be_Pages they all have an IsDeleted column...

The stacktrace doesn't give me much to go on - but it looks like it should help someone

[SqlException (0x80131904): Invalid column name 'IsDeleted'.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +212
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +245
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2811
System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +58
System.Data.SqlClient.SqlDataReader.get_MetaData() +112
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +6281668
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +6282737
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +424
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +28
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +211
System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +19
BlogEngine.Core.Providers.DbBlogProvider.SelectPage(Guid id) in E:\Projects\BlogEngine-HG-7\BlogEngine\DotNetSlave.BusinessLogic\Providers\DbBlogProvider.cs:1072
BlogEngine.Core.Page.DataSelect(Guid id) in E:\Projects\BlogEngine-HG-7\BlogEngine\DotNetSlave.BusinessLogic\Page.cs:638
BlogEngine.Core.BusinessBase`2.Load(TKey id) in E:\Projects\BlogEngine-HG-7\BlogEngine\DotNetSlave.BusinessLogic\BusinessBase.cs:303
BlogEngine.Core.Providers.DbBlogProvider.<FillPages>b__2(String id) in E:\Projects\BlogEngine-HG-7\BlogEngine\DotNetSlave.BusinessLogic\Providers\DbBlogProvider.cs:269
System.Linq.WhereSelectListIterator`2.MoveNext() +318
System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +578
System.Linq.Enumerable.ToList(IEnumerable`1 source) +78
BlogEngine.Core.Providers.DbBlogProvider.FillPages() in E:\Projects\BlogEngine-HG-7\BlogEngine\DotNetSlave.BusinessLogic\Providers\DbBlogProvider.cs:269
BlogEngine.Core.Page.get_Pages() in E:\Projects\BlogEngine-HG-7\BlogEngine\DotNetSlave.BusinessLogic\Page.cs:126
BlogEngine.Core.Page.GetFrontPage() in E:\Projects\BlogEngine-HG-7\BlogEngine\DotNetSlave.BusinessLogic\Page.cs:519
BlogEngine.Core.Web.HttpModules.UrlRewrite.ContextBeginRequest(Object sender, EventArgs e) in E:\Projects\BlogEngine-HG-7\BlogEngine\DotNetSlave.BusinessLogic\Web\HttpModules\UrlRewrite.cs:306
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171

Coordinator
Dec 10, 2010 at 11:17 PM

I would check your DB tables.  The IsDeleted column was added to be_Pages, be_Posts and be_Comments.  It's in the upgrade script too that you referred to.

The IsDeleted columns are either in your DB or they are not.

Dec 10, 2010 at 11:56 PM

The schema shows all 3 tables with an IsDeleted column and I can run SELECT IsDeleted FROM each of the 3 tables - they return 0, which is the default value that was inserted when they were created.

Coordinator
Dec 11, 2010 at 12:00 AM

Ok.  I would double check then and make sure the connection string in the web.config file is pointing to the correct server & database.

Dec 11, 2010 at 2:08 PM

Thanks Ben,

Spot on! When I'd updated the web.config I'd put back in place my original (Live) connection string and taken out my local testing one.

Everything seems to be there, my custom theme might need a bit of tweaking here and there but otherwise looks good.