This project is read-only.

2.5 DB upgrade script help

Feb 13, 2012 at 8:09 PM

I am in the process of upgrading from 2.0 to 2.5 using SQL CE and I totally forgot how to run the upgrade script.  Could someone please refresh my memory as to what software I need to accomplish this task. I have WebMatrix and Visual Web Developer Express 2010 installed.  Thanks for your help.

Feb 13, 2012 at 9:12 PM

Take a look at this project - you probably used something like this in the first place. There is stand-alone app to connect to CE database and add-in for visual studio, whichever you prefer.

Feb 13, 2012 at 11:13 PM

Trying to upgrade from BE 2.0 to BE 2.5 using SQL Compact Edition.

Thank you , I downladed and used the stand alone version of SQL compact 4.0 toolbox.  I received the following error when running the upgrade script provided in the SQL CE setup folder.

 Error Code: 80040E8B
 Message   : The foreign key constraint does not exist. [ FK_be_PostCategory_be_Categories ]
 Minor Err.: 25060
 Source    : SQL Server Compact ADO.NET Data Provider
 Err. Par. : FK_be_PostCategory_be_Categories

When trying to run the default page in Visual Web Developer Express I receive this error:

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: The column name is not valid. [ Node name (if any) = ,Column name = BlogID ]

Source Error:

Line 114:            <providers>
Line 115:                <clear/>
Line 116:                <add name="XmlRoleProvider" type="BlogEngine.Core.Providers.XmlRoleProvider, BlogEngine.Core" description="XML role provider"/>
Line 117:                <add name="SqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="BlogEngine" applicationName="BlogEngine"/>
Line 118:                <add name="DbRoleProvider" type="BlogEngine.Core.Providers.DbRoleProvider, BlogEngine.Core" connectionStringName="BlogEngine"/>

Source File: H:\Websites_2011\BlogEngine2.5.SAHC\web.config    Line: 116

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

<!-- [SqlCeException]: The column name is not valid. [ Node name (if any) = ,Column name = BlogID ] at System.Data.SqlServerCe.SqlCeCommand.ProcessResults(Int32 hr) at System.Data.SqlServerCe.SqlCeCommand.CompileQueryPlan() at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options) at System.Data.SqlServerCe.SqlCeCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.ExecuteReader() at BlogEngine.Core.Providers.DbMembershipProvider.GetAllUsers(Int32 pageIndex, Int32 pageSize, Int32& totalRecords) in E:\Projects\BlogEngine_25_Release\BlogEngine\DotNetSlave.BusinessLogic\Providers\DbMembershipProvider.cs:line 402 at System.Web.Security.Membership.GetAllUsers(Int32 pageIndex, Int32 pageSize, Int32& totalRecords) at BlogEngine.Core.Providers.XmlRoleProvider.ReadMembershipDataStore() in E:\Projects\BlogEngine_25_Release\BlogEngine\DotNetSlave.BusinessLogic\Providers\XmlProvider\XmlRoleProvider.cs:line 494 at BlogEngine.Core.Providers.XmlRoleProvider.Initialize(String name, NameValueCollection config) in E:\Projects\BlogEngine_25_Release\BlogEngine\DotNetSlave.BusinessLogic\Providers\XmlProvider\XmlRoleProvider.cs:line 314 at System.Web.Configuration.ProvidersHelper.InstantiateProvider(ProviderSettings providerSettings, Type providerType) [ConfigurationErrorsException]: The column name is not valid. [ Node name (if any) = ,Column name = BlogID ] (H:\Websites_2011\BlogEngine2.5.SAHC\web.config line 116) at System.Web.Security.Roles.Initialize() at System.Web.Security.Roles.EnsureEnabled() at System.Web.Security.Roles.RoleExists(String roleName) at BlogEngine.Core.Right.InitRightForBlogInstance() in E:\Projects\BlogEngine_25_Release\BlogEngine\DotNetSlave.BusinessLogic\Security\Right.cs:line 607 at BlogEngine.Core.Right.get_RightsByRole() in E:\Projects\BlogEngine_25_Release\BlogEngine\DotNetSlave.BusinessLogic\Security\Right.cs:line 595 at BlogEngine.Core.Right.EnsureBlogInstanceDataLoaded() in E:\Projects\BlogEngine_25_Release\BlogEngine\DotNetSlave.BusinessLogic\Security\Right.cs:line 561 at BlogEngine.Core.Right..cctor() in E:\Projects\BlogEngine_25_Release\BlogEngine\DotNetSlave.BusinessLogic\Security\Right.cs:line 111 [TypeInitializationException]: The type initializer for 'BlogEngine.Core.Right' threw an exception. at BlogEngine.Core.Right..ctor() [TargetInvocationException]: Exception has been thrown by the target of an invocation. at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache) at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) at System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) at System.Web.Configuration.HttpModulesSection.CreateModules() at System.Web.HttpApplication.InitModules() at System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) at System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) at System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) at System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) -->


Feb 14, 2012 at 4:27 PM


Feb 14, 2012 at 6:02 PM

So script failed on the very first line - I assume be_Blogs table was not created. There is no way to tell why it failed - it could be you pointing it to completely different DB file or this file is empty or wrong version or something else of this nature. You need to open DB file and examine what is in there, what tables you have, what FK constraints and why script can't find it. May be you have used different DB prefix and it should be not "be_Blogs" but "mycustomprefix_Blogs" or just "Blogs".

Feb 14, 2012 at 6:28 PM
Edited Feb 14, 2012 at 6:41 PM

Thank you for your help rtur

Powered by BlogEngine.NET

Microsoft® SQL Server® Compact  Version 4.0.8482.1

These are the tables in the database.

  • be_BlogRollItems
  • be_Blogs
  • be_Categories
  • be_DataStoreSettings
  • be_Pages
  • be_PingService
  • be_PostCategory
  • be_PostComment
  • be_PostNotify
  • be_Posts
  • be_PostTag
  • be_Profiles
  • be_Referrers
  • be_RightRoles
  • be_Rights
  • be_Roles
  • be_Settings
  • be_StopWords
  • be_UserRoles
  • be_Users

The database has over 300 users, lots of data.

Feb 14, 2012 at 6:57 PM

Jerry, what happened when you executed script? Did it hit first line and was aborted? Did it run all the way through ignoring errors? Looks like you got that be_Blogs created - or was it there before? And if you have be_PostCategory - does it have FK_be_PostCategory_be_Categories constraint on it? I suspect that you ran partial updates from DEV build and this script assumes you upgrading from or close, not In this case, you need to ignore part of the script that you ran previously, and only create tables that don't exist in your DB.




Feb 14, 2012 at 7:12 PM

I just checked another copy of the database and the script created the be_Blogs table, how do I tell if it has FK_be_PostCategory_be_Categories constraint on it?

Feb 15, 2012 at 6:34 PM

Anyone that knows SQL databases that wants to help get me upgraded to BE 2.5  woud be appreciated, I am willing to pay someone to do this. Thanks

Feb 15, 2012 at 7:59 PM

If you send me DB file I can take a look at it later tonight. No charge :)

Feb 15, 2012 at 9:53 PM

Thank you, where do I send it?