🔧 Maintenance Alert: World will be on Read-Only Mode on February 18th, 10:00 PM – 11:00 PM EST / 7:00 PM – 8:00 PM PST / 4:00 AM – 5:00 AM CET (Feb 19). Browsing available, but log-ins and submissions will be disabled.

K Khan
Aug 6, 2014
  4685
(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
The missing globe can finally be installed as a nuget package!

Do you feel like you're dying a little bit every time you need to click "Options" and then "View on Website"? Do you also miss the old "Globe" in...

Tomas Hensrud Gulla | Feb 14, 2025 | Syndicated blog

Cloudflare Edge Logs

Optimizely is introducing the ability to access Cloudflare's edge logs, which gives access to some information previously unavailable except throug...

Bob Davidson | Feb 14, 2025 | Syndicated blog

Comerce Connect calatog caching settings

A critical aspect of Commerce Connect is the caching mechanism for the product catalog, which enhances performance by reducing database load and...

K Khan | Feb 14, 2025

CMP DAM asset sync to Optimizely Graph self service

The CMP DAM integration in CMS introduced support for querying Optimizly Graph (EPiServer.Cms.WelcomeIntegration.Graph 2.0.0) for metadata such as...

Robert Svallin | Feb 13, 2025

PageCriteriaQueryService builder with Blazor and MudBlazor

This might be a stupid idea but my new years resolution was to do / test more stuff so here goes. This razor component allows users to build and...

Per Nergård (MVP) | Feb 10, 2025

Enhancing Optimizely CMS Multi-Site Architecture with Structured Isolation

The main challenge of building an Optimizely CMS website is to think about its multi site capabilities up front. Making adjustment after the fact c...

David Drouin-Prince | Feb 9, 2025 | Syndicated blog