Upgrading EPiServer Commerce 1 R2 SP1 to EPiServer Commerce 7.5, part 2

So the first thing I had to do was upgrading from version 1 R2 SP2 to 1 R3.

I followed the procedure as described in the SDK.

The first problem I ran into was that the upgrade script failed. In some way the application pool for the commerce manager could not be restarted. As I could not figure out why, I decided to edit the upgrade script. (See this blogpost for instructions on how to change EPiServer PowerShell scripts.)

The script that generated the errors was : Upgrade EPiServer Commerce.ps1

On line 229 I commented out the following, some way or another the script could not restart the Application Pool:

#$appPool = Get-WmiObject -Namespace "root\MicrosoftIISv2" -Class "IIsApplicationPool" | Where-Object{$_.Name -eq "W3SVC/APPPOOLS/$commerceManagerApplicationName"}
#$appPool.Recycle()

To be sure I added: “Start-Sleep -Seconds 10” after echo "Recycle AppPool ….." to give me time to recycle manually.

On line 286 I commented out the creation of the “Apps” virtual folder, as this one already existed and it threw an error:

#$serverComment = $selectedWebApplication.SiteName
#$iisWebSite = Get-WmiObject -Namespace 'root\MicrosoftIISv2' -Class IISWebServerSetting -Filter "ServerComment = '$serverComment'"
#$iisWebSiteName = $iisWebSite.Name
#$objIIS = new-object System.DirectoryServices.DirectoryEntry("IIS://localhost/$iisWebSiteName/Root")
		
#if (-not [System.DirectoryServices.DirectoryEntry]::Exists("IIS://LocalHost/$iisWebSiteName/ROOT/Apps")) {
#    echo "Creating Apps virtual directory for " $selectedWebApplication.SiteName
#	$appsFolderPhysicalPath = Join-Path $commerceManagerSharedPath "Shared\Apps"
#	New-EPiWebVirtualDirectory -SiteName $selectedWebApplication.SiteName -Name "Apps" -PhysicalPath $appsFolderPhysicalPath
#}

Now the upgrade script ran smoothly.

The next step is upgrading your source code. Which I was not able to do. I was not able to install the NuGet packages for the new version, as they don’t seem to exist anymore on the feed.

So I tried my luck. I changed the assembly redirects for the "offending" dll’s, only a few in my case.

<dependentAssembly>
        <assemblyIdentity name="EPiServer.Business.Commerce" publicKeyToken="8fe83dea738b45b7" culture="neutral" />
        <bindingRedirect oldVersion="1.1.2.62-7.65535.65535.65535" newVersion="7.0.243.0" />
</dependentAssembly>

<dependentAssembly>
        <assemblyIdentity name="Mediachase.BusinessFoundation.Data" publicKeyToken="41d2e7a615ba286c" culture="neutral" />
        <bindingRedirect oldVersion="2.4.3.0-7.65535.65535.65535" newVersion="7.0.243.0" />
</dependentAssembly>

<dependentAssembly>
        <assemblyIdentity name="Mediachase.Cms" publicKeyToken="" culture="neutral" />
        <bindingRedirect oldVersion="5.0.0.0-5.65535.65535.65535" newVersion="5.2.628.0" />
</dependentAssembly>

<dependentAssembly>
        <assemblyIdentity name="Mediachase.Commerce" publicKeyToken="6e58b501b34abce3" culture="neutral" />
        <bindingRedirect oldVersion="5.2.628.0-7.65535.65535.65535" newVersion="7.0.243.0" />
</dependentAssembly>

Next I had to remove a module that wasn’t removed by the upgrade script apparently and does not exist anymore:

<system.webServer>
  <modules>
    ....
    <add name="EventSubscriber" type="EPiServer.EventSubscriberHostModule, EPiServer" preCondition="managedHandler" /> 
    ....
  </modules>
</system.webServer>

And Bingo, Frontend available, EPiServer backend and the Commerce Manager available.

The Frontend showed some minor errors, which is to be expected as I could not upgrade my source to the new version. But this is of no importance as I want to upgrade to 7.5 anyway. And as those packages are available from the NuGet feed,I can also upgrade my source.

So the upgrade to R3 and EPiServer 7 went quite smoothly. Mainly I think of the decisions made when creating the shop. Hopefully the next stage will go as smoothly.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s