Part 2 of a five-part series on Sitecore migration and my new migration tool.
The previous post described the problems that make a legacy migration difficult: changing content models, relationships outside the page tree, language and version rules, presentation changes and the need to run everything again.
Version 3 of my new migration tool is my attempt to give that work a consistent home.
The tool reads an exported content repository, runs project-specific C# transformations and produces instructions for a target-side PowerShell script. The developer can inspect those instructions before applying them in Sitecore.
The central idea is to keep three responsibilities visible: reading the source, deciding what it should become, and applying the resulting changes.
Other available tools, including Sitecore's own Pathways app, provide a GUI some or all of those steps, however I prefer using my own tooling for large enterprise scale migrations where I believe pure code can be much more flexible and capable than a simple drag-and-drop UI.
One workflow, with a review point in the middle
The normal workflow is:
- Export the required source content.
- Open that export through a provider.
- Run a C# migration plugin.
- Generate newline-delimited JSON instructions file.
- Review the instructions and run a target dry run.
- Apply the changes in a compatible Sitecore PowerShell context, then validate the site.
The plugin does not need a live target connection to generate instructions. If it needs to inspect the target's templates, existing items or rendering definitions, it can use another exported repository.
That separation is useful during development. I can change a transformation, generate its output and compare the intended changes without editing the target each time.
This workflow addresses project-specific transformations. It is separate from a production-to-lower-environment refresh, and it should be considered alongside Sitecore's supported migration tooling when planning a replatform. Sitecore migration overview
Providers make the source format replaceable
A provider translates an input format into the tool's repository model. The plugin queries items through the same SDK regardless of which implemented provider opened them.
V3 currently includes two:
| Provider | Input | Useful when |
|---|---|---|
| YAML | Physical Sitecore serialization files. | The source is available through a configured Sitecore CLI serialization workflow. |
| NDJSON | Source-item exports produced by the included PowerShell exporter. | A source team can run an export script and supply the resulting files. |
YAML is the default. The optional NDJSON provider accepts a single export file or a folder containing several exports.
The extensible provider contract is also useful, but it is not a claim that every CMS or remote API already has an implementation. The shipped providers and their capabilities are the starting point.
A repository gives the plugin an indexed view of items
A repository exposes item identities, paths, templates and relationships. The runtime builds an in-memory metadata index so that selecting items does not require loading every field.
For example, a query can choose a content branch and exclude an obsolete subtree before reading any field values:
var query = ItemQuery.Create()
.Path("/sitecore/content/SiteCollection/Site/Home")
.ExcludePath("/sitecore/content/SiteCollection/Site/Home/Archive")
.Build();
var items = source.ExecuteQuery(query);
Here, source is the repository obtained from the migration job. A path scope includes its root and descendants by default.
Field reads happen separately when the transformation needs them. The runtime caches immutable field snapshots, while a projection creates a mutable copy for the output. That keeps one mapping from accidentally changing the source values another mapping expects to read.
Migration entries are ordinary C# methods
A migration plugin is a compiled assembly containing methods marked with MigrationEntry. Each selected entry receives an IMigrationJob and a cancellation token.
This is code you write and compile yourself as the developer working on the migration project. The purpose of this code is to query your exported source data, enumerate it, and project it into your desire shape for the target system.
The job exposes repositories and an instruction sink: the object that collects the operations to write to the output file.
This is the basic shape:
\[MigrationEntry("CopyContent")]
public static async Task RunAsync(IMigrationJob job, CancellationToken cancellationToken)
{
var source = job.Repositories.Get("source");
// Query items, read fields, transform content,
// and add instructions using ordinary C#.
}
This is an entry-method excerpt; the next post supplies the complete class and required namespaces.
The code can use loops, helper functions, dictionaries and explicit validation. A transformation that combines three source items into one target data source can be written as a normal function, rather than forced into a sequence of framework-specific actions.
Your plugin code references the provided SDK. It does not need to reference Sitecore assemblies or understand how the YAML parser works.
Instructions describe the changes independently of the source
The output is NDJSON, or newline-delimited JSON: one JSON object per physical line.
There are two different NDJSON contracts in this workflow. A source export contains item records. Generated output contains operations such as CreateItem and UpdateFields. The target importer consumes the operations, not the raw source export.
That distinction matters enough to make explicit: exporting items.ndjson from a source system does not produce a ready-to-import migration.
Instruction helpers cover item creation, field updates, renaming, moving, template changes, version resets and deletion. Plugins can also create separate instruction files when a migration benefits from independently reviewable groups.
The output becomes the handoff between the transformation code and target execution. A reviewer can see exactly which items and fields the plugin intends to change.
Languages and versions are explicit
V3 preserves the distinction between shared, unversioned and versioned fields.
A projection can select the languages and source versions the migration needs, then choose the target version key. For example, selecting the latest source version and normalizing it to the first target version are separate operations:
var outputFields = fields.Project()
.ForLanguages("en")
.Latest()
.NormalizeToFirst()
.Build();
The generated field data retains source language/version metadata when normalization changes the target address. That is particularly useful when a later media download must still retrieve the original source version.
Selection can only use information the provider actually supplies. A source-item export containing one selected version does not automatically provide the runtime with the publication metadata needed for a separate published-version projection.
The output has safeguards, but the migration still needs validation
V3 writes generated instructions to staging files and publishes each file atomically when the entry succeeds. A failed generation should not replace that file with half an output.
That guarantee applies per file. It is not a transaction across an entire migration, and it says nothing about rolling back changes already applied inside Sitecore.
There are also two useful checks with different purposes:
- generate --check validates repository setup, indexes, plugin discovery and output names without invoking the transformation.
- Migrate-Data.ps1 -DryRun previews target operations without applying them.
Neither proves that a rebuilt page looks correct or that every referenced asset resolves. The target consumer can report warnings and continue, so the logs and resulting site need review.
What V3 deliberately leaves to the project
V3 does not infer the new content model, build the replacement frontend or decide whether an old component should be retired.
Those decisions belong in project mappings and reusable transformation code. The tool provides the repository, field and instruction mechanics around them.
That is the connection to the problems in the first post. Providers separate extraction from transformation. Repositories make relationships available. Projections make language/version choices visible. Instruction files provide a review point, and stable project-defined identities support repeatable runs.
The next post follows that workflow from an export to a first plugin and target dry run.

