November Happy Hour will be moved to Thursday December 5th.

K Khan
Aug 6, 2014
  4654
(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
Adding Geolocation Personalisation to Optimizely CMS with Cloudflare

Enhance your Optimizely CMS personalisation by integrating Cloudflare's geolocation headers. Learn how my Cloudflare Geo-location Criteria package...

Andy Blyth | Nov 26, 2024 | Syndicated blog

Optimizely SaaS CMS + Coveo Search Page

Short on time but need a listing feature with filters, pagination, and sorting? Create a fully functional Coveo-powered search page driven by data...

Damian Smutek | Nov 21, 2024 | Syndicated blog

Optimizely SaaS CMS DAM Picker (Interim)

Simplify your Optimizely SaaS CMS workflow with the Interim DAM Picker Chrome extension. Seamlessly integrate your DAM system, streamlining asset...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Optimizely CMS Roadmap

Explore Optimizely CMS's latest roadmap, packed with developer-focused updates. From SaaS speed to Visual Builder enhancements, developer tooling...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Set Default Culture in Optimizely CMS 12

Take control over culture-specific operations like date and time formatting.

Tomas Hensrud Gulla | Nov 15, 2024 | Syndicated blog

I'm running Optimizely CMS on .NET 9!

It works 🎉

Tomas Hensrud Gulla | Nov 12, 2024 | Syndicated blog