Introducing My Sitecore Migration Tool: From Source Content to Reviewable Instructions

Technical Director
  • Twitter
  • LinkedIn

Part 1 of a five-part series on SitecoreAI migration and my new migration tool.

Moving content sounds straightforward until you look closely at a real website.

A page might depend on a local data source, a globally shared disclaimer, several media items and a presentation definition that only makes sense to the old application. The replacement site may use different components, different fields and a different approach to page composition. Copying the page item successfully gets you only part of the way there.

Across legacy Sitecore migrations, the difficult work has usually been deciding what the content should become and making that decision repeatable. Those experiences shaped the third version of my migration tool. Before introducing V3, I want to explain the problems a tool needs to address, whether you use mine, another product or your own scripts.

A new platform usually brings a new content model

A legacy implementation reflects years of development and authoring decisions. Its templates may combine content, styling options and assumptions about MVC renderings. A new SitecoreAI implementation often introduces a different set of components and a Next.js frontend.

Consider a product page. The old site might store its heading, description, image and button label in separate items. The new component expects one data source with Heading, Body, Image and Link fields. There is no useful one-to-one copy operation for that transformation.

The migration needs an explicit answer to three questions:

Question Example decision
What should be retained? Keep the page identity, authored copy and image reference.
What should be transformed? Combine several source items into one component data source.
What should be replaced? Build presentation using the new rendering definitions and placeholders.

This is why I separate content extraction from transformation. A reliable export gives us evidence to inspect. The mapping describes the intended result. Neither should be hidden inside a large import loop.

The item tree is only part of the dependency graph

Sitecore's parent-child hierarchy is convenient to navigate, but it does not describe every dependency.

A page can reference content elsewhere in the tree. A rendering refers to a data source and rendering definition. A data source can contain image, link and list-field references. A global content item may be used by dozens of pages.

When those dependencies are overlooked, an import can create a plausible-looking tree with broken relationships.

A migration tool should preserve identities where that is useful and allow deliberate new identities where the model changes. It also needs a way to resolve related items outside the current page branch. Otherwise, developers end up making repeated live calls or writing increasingly complicated path searches around the migration.

Creating dependencies in the right order matters too. A target parent and template must exist before a child item can be created. A page's new presentation should not refer to data sources that the migration has not produced.

Field values have more than one address

A Sitecore field is not simply a name and a string.

Shared fields have one value across languages and versions. Unversioned fields vary by language. Versioned fields vary by both language and version. The migration has to read the correct source scope and write the intended target scope.

There is also a difference between selecting a source version and choosing a target version. We might select the latest authored English version from the old site and write its content into version 1 of a new target item. That is a deliberate normalization decision, rather than a reason to pretend the source version was 1.

The treatment of missing values matters just as much:

  • An omitted field can preserve a target value.
  • An empty string is an explicit value.
  • Resetting a field lets Sitecore apply its reset behavior.

A tool that collapses those operations into “copy whatever value we found” can overwrite target settings or erase intentional blanks.

Presentation needs its own migration plan

A page can have all the correct text and still render incorrectly.

Sitecore presentation includes rendering definitions, data-source references, component order, placeholders and rendering parameters. Shared presentation and language/version-specific final presentation may contribute different parts of the result. Page designs and partial designs can add inherited composition.

Those relationships need to be understood before rebuilding a page. Copying legacy presentation XML does not turn an old component into a compatible headless component.

I prefer to treat page creation and page composition as separate migration concerns. First establish the hierarchy and page fields. Then create the required data sources and assemble presentation against the target applicaation's actual component contracts.

This also makes review easier. A missing title and a component assigned to the wrong placeholder are different defects and should be diagnosable separately.

A migration needs to survive the second run

The first successful run is rarely the final run.

Authors continue changing content. Developers refine mappings. Reviewers find a page family that behaves differently. The migration needs to run again without creating another copy of every generated item.

Stable IDs help, but they are only part of the answer. A repeatable migration also needs clear ownership of fields and presentation, predictable instruction order, and deliberate behavior when an item already exists.

I would avoid describing an entire migration as idempotent just because item creation checks for an existing ID. Renames, moves, deletes, version operations and presentation changes still need to behave correctly when repeated.

The useful question is more concrete: if we regenerate and apply this particular migration again, what changes, what stays in place and what requires cleanup?

Large sites expose inefficient assumptions

A local export changes what is practical. Developers can inspect content, develop mappings and generate instructions without keeping a live CMS connection open for every lookup.

That does not mean every field and media file should be loaded into memory at startup. Metadata such as IDs, paths, parents and template IDs is enough for many selection decisions. Field values can be loaded when a transformation needs them, and reused when another mapping requests the same item.

Media introduces another concern: its item metadata and binary file are different things. A migration may carry the item fields in an export while retrieving the file separately. That needs a defined download route and a way to detect unchanged bytes.

Performance work should support the normal authoring experience for migration code. A simple sequential loop should be efficient before anyone needs to introduce parallel execution.

Review the intended changes before applying them

I want an inspectable artifact between transformation and target execution.

That artifact lets a developer examine the IDs, field maps and operations before the target changes. It also gives reviewers something concrete to compare between runs. An unexpected delete or a rewritten presentation field should be visible before execution.

There are still several kinds of validation. Checking that a plugin can load is different from checking its business mappings. A target dry run is useful, but it is not a substitute for applying the instructions to a disposable environment and reviewing the resulting site.

Sitecore provides its own migration tooling, including Pathway for legacy XM/XP migrations. Evaluate that supported route as part of planning. The requirements above remain useful when assessing where project-specific content transformations belong. Sitecore migration guidance

The migration tool's job is to make those transformations easier to express, inspect and repeat. The team still owns the decisions about what the new site should contain and how it should work.

In the next post, I will introduce the latest version of my own migration tool, now up to version 3, and show how its providers, C# plugins and instruction files address all these problems.