Before you put a number on an XP to SitecoreAI migration, spend half a day with the actual instance. Part 1 covers sites, renderings and content volumes.
A migration estimate is only as good as the inventory behind it. Most of this year I have been writing and reviewing estimates for moving Sitecore XP solutions to XM Cloud, now SitecoreAI. And one thing I noticed is that the spreadsheet usually looks fine, until someone opens the real Sitecore instance.
So now, before estimating, I connect to the XP CM with Sitecore PowerShell Extensions (SPE) and pull the numbers myself. In this two part series I want to share the seven gaps I kept finding, along with the scripts I use to catch them. Let's look at the first three.
All scripts below are read-only. Even so, run them on a non-production CM or a recent copy of master. Replace and with your own paths.
Site count taken from the database list
On one estimate the scope said well over a dozen sites. The actual number was a handful. Somebody had counted the SQL databases (core, master, web, xConnect pools, forms and so on) and used that as the site count. Every downstream line, be it content migration, front-end build or QA, got multiplied by the wrong number.
The fix is simple. Let Sitecore tell you how many sites there are.
For SXA sites, list the site definitions:
Get-ChildItem -Path "master:/sitecore/content/" -Recurse |
Where-Object { $.TemplateName -eq "Site Definition" } |
Select-Object Name,
@{ n = "SiteName"; e = { $["SiteName"] } },
@{ n = "HostName"; e = { $_["HostName"] } },
ItemPath
For config based sites:
[Sitecore.Sites.SiteManager]::GetSites() |
Where-Object { $.Properties["rootPath"] -like "/sitecore/content/*" } |
Select-Object Name,
@{ n = "RootPath"; e = { $.Properties["rootPath"] } },
@{ n = "HostName"; e = { $_.Properties["hostName"] } }
The rootPath filter removes system sites like shell, login and admin.
Add this output to the estimate as an appendix and get the client to confirm it in writing. It is a ten minute exercise and it can move the estimate by months.
Rendering variants not counted
If you have worked on SXA, you know a lot of the presentation logic lives in rendering variants, and on newer versions in Scriban. When moving to headless, every meaningful variant becomes rebuild work in Next.js or the ASP.NET Core SDK. I reviewed one sizing where the variant count was zero. On a mature SXA site that is never the case.
Count variants per rendering, and Scriban templates separately:
$root = "master:/sitecore/content///Presentation/Rendering Variants"
$all = Get-ChildItem -Path $root -Recurse
Variants per rendering
$all | Where-Object { $.TemplateName -eq "Variant Definition" } |
Group-Object { $.Parent.Name } |
Sort-Object Count -Descending |
Select-Object @{ n = "Rendering"; e = { $_.Name } }, Count
Scriban templates
($all | Where-Object { $_.TemplateName -eq "Scriban" }).Count
Do confirm the template names on your SXA version before running this.
The other half is custom renderings. The list is almost always longer than what the site actually uses. Here is how to find renderings nothing points at:
Get-ChildItem -Path "master:/sitecore/layout/Renderings/Project" -Recurse |
Where-Object { $.TemplateName -in @("Controller rendering", "View rendering") } |
ForEach-Object {
[pscustomobject]@{
Rendering = $.Name
UsedBy = @(Get-ItemReferrer -Item $_).Count
}
} | Sort-Object UsedBy
A few things to note:
1. Run it for the Feature folder as well if your renderings live there.
2. Get-ItemReferrer reads the link database, so rebuild it first if you are not sure it is current.
3. Anything with UsedBy as 0 is a candidate to drop. Agree it with the client and record the decision.
Once you have the final list, rate each rendering simple, medium or complex by looking at a real page that uses it. A complexity split decided without opening the renderings is just a guess.
Content and media volumes left as "TBC"
At RFP stage the client often can't share item counts or media size. But if you have access to an instance, you can get them in a few minutes.
Items per language:
Get-ChildItem -Path "master:/sitecore/content/" -Recurse -Language * |
Group-Object { $.Language.Name } |
Select-Object @{ n = "Language"; e = { $.Name } }, Count
Media library size, and how much of it is actually referenced:
$media = Get-ChildItem -Path "master:/sitecore/media library" -Recurse |
Where-Object { $_["Size"] }
$totalGB = ($media | ForEach-Object { [long]$_["Size"] } |
Measure-Object -Sum).Sum / 1GB
$orphans = $media | Where-Object { -not (Get-ItemReferrer -Item $_) }
"Media items: {0} Total: {1:N1} GB Unreferenced: {2}" -f `
$media.Count, $totalGB, $orphans.Count
On a large library, narrow the path, for example to /sitecore/media library/Project. The unreferenced count is the interesting one. If a good portion of the library is not linked from anywhere, you can propose leaving it behind and reduce migration effort straight away.
If you really can't get access, write the volumes as an assumption with a range, like "up to N items across M languages and up to X GB of media", and price that range. A silent assumption becomes your problem later.
In Part 2 I will cover the remaining four: custom pipelines and computed index fields, personalization, the CDN in front of the site, and the parallel run cost that keeps going missing.
Read more:
Top comments (0)