Episerver Database version issues

Vote:
 

Hi Team,

In my local environment, I have EPiServer.CMS.Core 11.14.0 version and on Production it has EPiServer.CMS.Core 11.13.0 version.

I tried connecting the production EpiServer database from my local environment.

After some time our team got notifications, saying Production is down, and below is the production logs report. And people around me are saying, this is because my local has a different version and Production has a different version of EpiServer.

I have only read access to Production and I just used those Db details in my local web.conig file connection string.

Can someone please help me in understanding whether this issue caused by my local environment using the Prod connection string?

Below is error log

2020-09-17 17:52:24,613 [11] ERROR EPiServer.Framework.Initialization.InitializationEngine: Initialize action failed for 'Initialize on class EPiServer.Data.DataInitialization, EPiServer.Data, Version=11.13.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7'
System.NotSupportedException: The assemblies for 'CMS' have not been updated to work with the current database version '7060.0'. Supported database version is '7059.0'. Make sure the NuGet packages are updated and build the solution   at

EPiServer.Data.SchemaUpdates.Internal.DatabaseSchemaManagerImplementation.ThrowUpdateCodeException(String displayName, Version databaseVersion, Version requiredVersion)
   at EPiServer.Data.SchemaUpdates.Internal.DatabaseSchemaManagerImplementation.EnsureDatabaseSchema(DataAccessOptions dataAccessOptions)
   at EPiServer.Data.DataInitialization.Initialize(InitializationEngine context)
   at EPiServer.Framework.Initialization.Internal.ModuleNode.Execute(Action a, String key)
   at EPiServer.Framework.Initialization.Internal.ModuleNode.Initialize(InitializationEngine context)
   at EPiServer.Framework.Initialization.InitializationEngine.InitializeModules()
System.NotSupportedException: The assemblies for 'CMS' have not been updated to work with the current database version '7060.0'. Supported database version is '7059.0'. Make sure the NuGet packages are updated and build the solution.
   at EPiServer.Data.SchemaUpdates.Internal.DatabaseSchemaManagerImplementation.ThrowUpdateCodeException(String displayName, Version databaseVersion, Version requiredVersion)
   at EPiServer.Data.SchemaUpdates.Internal.DatabaseSchemaManagerImplementation.EnsureDatabaseSchema(DataAccessOptions dataAccessOptions)
   at EPiServer.Data.DataInitialization.Initialize(InitializationEngine context)
   at EPiServer.Framework.Initialization.Internal.ModuleNode.Execute(Action a, String key)
   at EPiServer.Framework.Initialization.Internal.ModuleNode.Initialize(InitializationEngine context)
   at EPiServer.Framework.Initialization.InitializationEngine.InitializeModules()

#228138
Sep 19, 2020 0:12
Vote:
 

If local development and production uses different database schemas, and you have this in your web.config locally, the production database would be updated:

<episerver.framework updateDatabaseSchema="true">

More information: https://world.episerver.com/documentation/developer-guides/CMS/Deployment/automatic-schema-updates/

Episerver has a tool somewhere that would tell you if there are changes to the database schema between version 11.13.0 and 11.14.0, but I can't find it right now.

Your options, choose one

  • Roll back to database backup in production
  • Upgrade production to 11.14.0
  • Manually rolling back the database changes, after inspecting the upgrade script
#228160
Sep 20, 2020 6:01
Vote:
 

Hi SasiRekha,

Well looking at the error message you have had write access to the database and your local environment has now updated the production database schema to the version you are running locally.

It is easy to be wise afterwards, but why oh why have you connected from development to production?! Why the production DB allows connections from other places than the production environment web servers?

Anyways, when you say you have read only access do you mean your personal account (you have SQL login or your domain account has read only access)? Did you copy the connection string from production and just pasted that to your local environment? If yes, of course you know have read and write access to DB.

Why the schema has been updated? Most likely because you have in your development web.config episerver.framework updateDatabaseSchema=true so the DB schema is automatically updated for you and this case the prod DB schema was updated.

Hopefully you have already gotten this sorted out in production (DB rollback or you have been forced to deploy the latest to production...)

Anyways related to this is also the content model updates that would get updated to prod DB in your case, so would be wise to set the "enableModelSyncCommit=false" IF you really must do this kind of crazy cowboy stuff (see documentation for the enableModelSyncCommit).

If you need to debug against production database or use the production database for some other reason then the only real option is to get a DB backup/bacpac and use that on your development environment.

edit heh, was writing at the same time as Tomas

#228161
Edited, Sep 20, 2020 6:12
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.