Reordered renderings while migrating from Sitecore 7.2 to 9.3

Recently, I was working on a Sitecore migration project from 7.2 to 9.3. We had used Sitecore Express Migration Tool to migrate the content, templates, layouts and media items. However, the renderings on the migrated content were completely out of order.

Assuming concurrency to be the culprit, I changed the Concurrency settings in Default.config of the Express Migration Tool to the following, to prevent parallelism, but the issue was still not resolved.
<!--
MAX CONCURRENCY LEVEL
Maximum concurrency level allowed for parallel tasks execution.
Default value: 100 -->
<setting name="MaxConcurrencyLevel" value="1" />

<!--
BIG BLOB MAX CONCURRENCY LEVEL
Maximum concurrency level allowed for parallel migration of big blobs stored in a database. -->
<setting name="BigBlobMaxConcurrencyLevel" value="1" />
</settings>

After much investigation, I was no where near a solution and I reached out to Sitecore Support. They pointed me to this KB Article https://support.sitecore.com/kb?id=kb_article_view&sysparm_article=KB0672981

Steps:

  • Back up the Master Database
  • Install a clean version of Sitecore 8.2 Update 6
    1. Download the ZIP archive of installation from Sitecore Downloads: Sitecore Experience Platform 82 Update6
    2. Extract the ZIP file into C:\inetpub\wwwroot
    3. Configure the application in IIS and update the hosts file
    4. Update the connection string to use the Master Database
  • Create an ASPX page in the website root called “FixRenderings.aspx”
  • Place the following method in the the ASPX page and call it in the Page_Load method
//collect all the affected items (these may be all content items or items of a specific template) and use the method below for each item:

public void UpdateLayoutField(Item item)
{
bool isSharedLayoutFieldUpdated = false;

foreach (var language in item.Languages)
{
Item itemInLanguage = _database.GetItem(item.ID, language);
if (itemInLanguage.Versions.Count > 0)
{
foreach (Item itemVersion in itemInLanguage.Versions.GetVersions())
{
foreach (Field f in itemVersion.Fields)
{
if (f.ID == FieldIDs.FinalLayoutField)
{
itemVersion.Editing.BeginEdit();
string fieldValue = Sitecore.Data.Fields.LayoutField.GetFieldValue(itemVersion.Fields[FieldIDs.FinalLayoutField]);
LayoutField.SetFieldValue(f, fieldValue);
itemVersion.Editing.EndEdit();
}
}

if (!isSharedLayoutFieldUpdated)
{
foreach (Field f in itemVersion.Fields)
{
if (f.ID == FieldIDs.LayoutField)
{
itemVersion.Editing.BeginEdit();
string fieldValue = LayoutField.GetFieldValue(itemVersion.Fields[FieldIDs.LayoutField]);
LayoutField.SetFieldValue(f, fieldValue);
itemVersion.Editing.EndEdit();

isSharedLayoutFieldUpdated = true;
}
}
}
}
}
}
}
  • Open the ASPX page in a browser and wait for the code to execute.
  • The renderings will now be fixed.

A Technical Evangelist with 16+ years of experience in designing large scale data-driven applications and managing development teams using varied technologies.