Try our conversational search powered by Generative AI!

K Khan
Aug 6, 2014
  4549
(0 votes)

Upgrade to EPiServer Commerce 7.10.1 (ECRP)

It was not a smooth upgrade for me, this blog is to share and summarize my experience. I have multiple issues especially in data migration and accessing Commerce e manager after upgrade.

Error in update-epidatabse

System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near 'MERGE'. You may need to set the compatibility level of the current database to a higher value to enable this feature.

Fixes:
Option 1: Error occurs If you are working in SQL Server 2012 database and it is runnning with compability level "SQL Server 2005". You can change the compability level for your database by rightclick on the database in SQL Server Managment Studio, select Properties, select Options and then there is a dropdown Compability Level.

Option 2:
1 – Export SQL Changes using package manager console PM>Export-EPiUpdates
2 - Console manager will show you a path
3 - Edit/Correct Script File 7.10.0.sql
4 - run update.bat in command mode, (Process is defined http://world.episerver.com/Documentation/Items/Developers-Guide/EPiServer-CMS/75/Deployment/Updating-EPiServer-via-NuGet/)

Data Migration Issues:

Custom Blobs: We are using a custom blob provider to upload images on Cloudinary. Folder/File names are based on Blob ID. Images were not available after upgarde because probably probably Guids for same blob source have been updated and in result got 404. I will be thankful if EPiServer can investigate this further and recommend some solution. Further if this is case please avoid these type of conversions whereever possible. as it can be a big issue In Live Enviornments or if we have 2000 products asserts.
Fixe: Uploaded all images manually in CMS Edit mode.


Data Migration can fail due to any reason specific to your data. That needs a fix before upgrade but to fix it you need to know the issue that can be logged with below code. After upgrade Site will redirect to data migration screen every time it needs to turn off to fix the errors. After fixing the data issue, remove comments from the web.config and run the data migration again or you will not be able to login in Commerce Manager without upgrade.

How to turn off Migration screen:

Comment this line from web.config
<add name="MigrationInitializationModule" preCondition="managedHandler" type="EPiServer.Commerce.Internal.Migration.MigrationInitializationModule, EPiServer.Commerce.Internal.Migration" />

How to Log the data issues:

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Web;
using EPiServer.Commerce.Catalog.ContentTypes;
using EPiServer.Commerce.Catalog.Linking;
using EPiServer.Core;
using EPiServer.Framework;
using log4net;
using Mediachase.Commerce.Catalog;
using Mediachase.Commerce.Catalog.Objects;namespace EPiServer.Commerce.Sample
{
[ModuleDependency(typeof(Initialization.InitializationModule))]
public class ErrorLoggerInitializationModule : IInitializableModule
{
private static readonly ILog _log = LogManager.GetLogger(typeof(ErrorLoggerInitializationModule));public void Initialize(Framework.Initialization.InitializationEngine context)
{
var referenceConverter = context.Locate.Advanced.GetInstance<ReferenceConverter>();
var contentLoader = context.Locate.Advanced.GetInstance<IContentLoader>();
var linksRepository = context.Locate.Advanced.GetInstance<ILinksRepository>();ValidateChildren(referenceConverter.GetRootLink(), contentLoader, linksRepository);
}private void ValidateChildren(ContentReference contentLink, IContentLoader contentLoader, ILinksRepository linksRepository)
{
IContent content;
if (!contentLoader.TryGet(contentLink, out content))
{
return;
}foreach (var property in content.Property)
{
try
{
// Validates isNull for the property.
var isNull = property.IsNull;if (_log.IsInfoEnabled)
{
_log.InfoFormat(CultureInfo.CurrentCulture,
"Property '{0}' for content '{1}' with id '{2}' can check it's null value.", property.Name,
content.Name, content.ContentLink.ID);
}
}
catch (OutOfMemoryException)
{
throw;
}
catch (Exception exception)
{
if (_log.IsErrorEnabled)
{
_log.ErrorFormat(CultureInfo.CurrentCulture,
"Property '{0}' for content '{1}' with id '{2}' contains the following error '{3}'.", property.Name,
content.Name, content.ContentLink.ID, exception.Message);
}
}
}var children = contentLoader.GetChildren<IContent>(contentLink);
foreach (var child in children)
{
ValidateChildren(child.ContentLink, contentLoader, linksRepository);
}if (content is NodeContent || content is EntryContentBase)
{
var links =
linksRepository.GetRelationsBySource(contentLink).OfType<ProductVariation>().Select(x => x.Target);
foreach (var linkReference in links)
{
ValidateChildren(linkReference, contentLoader, linksRepository);
}
}
}public void Preload(string[] parameters)
{}public void Uninitialize(Framework.Initialization.InitializationEngine context)
{}
}
}



Other related resources on upgrade topics are
http://world.episerver.com/Blogs/K-Khan-/Dates/2014/7/EPiServer-Commerce-Upgrade-strategy-in-light-of-ECRP/

http://world.episerver.com/Blogs/Richly/Dates/2014/8/For-Those-Who-Had-Issues-Updating-to-Commerce-710/

http://world.episerver.com/Forum/Developer-forum/-EPiServer-75-CMS/Thread-Container/2014/7/Error-in-update-epidatabse/?pageIndex=2

Aug 06, 2014

Comments

Aug 11, 2014 11:12 AM

Could you share the code you have for your blob provider? I made a simple test and didn't get any problems, but I probobly missed something.

K Khan
K Khan Aug 11, 2014 11:23 AM

Please check your email

K Khan
K Khan Aug 26, 2014 03:31 PM

Updates - We can't replicate the blob related issue.
/K

Please login to comment.
Latest blogs
Optimizely and the never-ending story of the missing globe!

I've worked with Optimizely CMS for 14 years, and there are two things I'm obsessed with: Link validation and the globe that keeps disappearing on...

Tomas Hensrud Gulla | Apr 18, 2024 | Syndicated blog

Visitor Groups Usage Report For Optimizely CMS 12

This add-on offers detailed information on how visitor groups are used and how effective they are within Optimizely CMS. Editors can monitor and...

Adnan Zameer | Apr 18, 2024 | Syndicated blog

Azure AI Language – Abstractive Summarisation in Optimizely CMS

In this article, I show how the abstraction summarisation feature provided by the Azure AI Language platform, can be used within Optimizely CMS to...

Anil Patel | Apr 18, 2024 | Syndicated blog

Fix your Search & Navigation (Find) indexing job, please

Once upon a time, a colleague asked me to look into a customer database with weird spikes in database log usage. (You might start to wonder why I a...

Quan Mai | Apr 17, 2024 | Syndicated blog