بنقرة واحدة
update-xperience
Update Xperience by Kentico packages (NuGet + npm) including database migrations and CI store
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Update Xperience by Kentico packages (NuGet + npm) including database migrations and CI store
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | update-xperience |
| description | Update Xperience by Kentico packages (NuGet + npm) including database migrations and CI store |
| disable-model-invocation | true |
You are tasked with updating this Xperience by Kentico project to the latest version (or a specific target version if specified by the user).
Before starting, the PowerShell script will automatically validate:
If these checks fail, the script will exit with clear error messages. If not on a feature branch, create one first:
git checkout -b "update/xperience-$(Get-Date -Format 'yyyy-MM-dd')"
Follow these steps systematically to ensure a complete and correct update:
Execute the Update-Xperience.ps1 PowerShell script to automate mechanical tasks. Run from the repo root:
# For latest version
.\scripts\Update-Xperience.ps1
# For specific version
.\scripts\Update-Xperience.ps1 -TargetVersion "31.0.0"
# Dry run to preview changes
.\scripts\Update-Xperience.ps1 -DryRun
# Skip npm updates (if needed)
.\scripts\Update-Xperience.ps1 -SkipNpmUpdate
# Skip prerequisite checks (not recommended)
.\scripts\Update-Xperience.ps1 -SkipPrerequisites
The script will:
--kxp-ci-status / --kxp-ci-enable, self-healing a DB left disabled by a previously interrupted run), clear CI_FileMetadata, and run --kxp-ci-restore to apply CI XML files to the database before any package updates (assembly and DB are still on the same version at this point)--kxp-ci-disable for the duration of the package updatedotnet restore (preserves Kentico.Xperience.MiniProfiler which has independent versioning; resolves each package's version individually against NuGet with preview fallback)npm audit fix for security vulnerabilitiesdotnet run --kxp-update --skip-confirmation for database migrations--kxp-ci-enable — the script always leaves CI enabled at the end, even if the update failsdotnet run --kxp-ci-store to serialize updated objectsUse the Kentico docs MCP server to research the release notes for the target version. Search for:
For each relevant release between the old and new version, review:
appsettings.json keys--kxp-update does NOT handle automatically — these are often listed under "Manual steps", "Refresh notes", or "Upgrade guide" sections in the docsImportant: Explicitly call out any manual steps to the user before proceeding. For example:
Program.cs/ServiceConfiguration.csPresent any found manual steps as a checklist for the user to action.
If the build fails:
Common issue — NU1605 package downgrade errors: After a Kentico update, the build may fail with errors like:
error NU1605: Detected package downgrade: SomePackage from X.Y.Z to A.B.C
Goldfinch.Web -> Kentico.Xperience.WebApp 31.5.1 -> SomePackage (>= X.Y.Z)
Goldfinch.Web -> SomePackage (>= A.B.C)
This means a package is pinned in Directory.Packages.props at a lower version than Kentico now requires. Check whether the project actually uses that package's API in code (Grep for its namespace). If not used directly, remove it from both Directory.Packages.props and all .csproj files — it's a transitive dependency that Kentico should own. If it is used directly, bump the version in Directory.Packages.props to the required minimum.
The CI store may fail with an error like:
Could not find a part of the path '...\assets\contentitems\...\filename.svg'
This means a content item has an asset (image/file) that exists in the database but not in the local assets/ folder — typically because an asset was uploaded to the CMS but --kxp-ci-store was never run and committed afterwards.
Understanding the assets/CI relationship:
assets/contentitems/ is the runtime folder for uploaded files — gitignoredApp_Data/CIRepository) stores the binary files alongside their XML metadata — tracked in git--kxp-ci-restore populates assets/ from the CI repository; --kxp-ci-store reads from assets/ to serialize into the CI repositoryResolution options (in order of preference):
--kxp-ci-store.--kxp-ci-store. The correct file can be committed separately later.git checkout HEAD -- <path> to keep the update PR clean. Address the missing asset separately.The root cause is always the same: an asset was uploaded without committing the CI store output. After fixing, always run --kxp-ci-store and commit after uploading new assets.
After the build succeeds, recommend the user test these critical areas locally:
https://localhost:52623/admin)The App_Data/CIRepository/ folder contains serialized Kentico objects that must be committed:
git status src/Goldfinch.Web/App_Data/CIRepository/When everything is working:
build(sln): update to Xperience vX.X.X
- Updated Kentico.Xperience.* packages in Directory.Packages.props
- Updated @kentico/* npm packages in admin client
- Applied database migrations via --kxp-update
- Serialized CI objects with --kxp-ci-store
[If applicable: - Fixed breaking changes: <description>]
🤖 Generated with Claude Code
CMSEnableCI valueCI_FileMetadata and runs --kxp-ci-restore before the NuGet package update. This is critical — the assembly and DB must be on the same version for CI restore to run, and it must happen before the migration so --kxp-ci-store serialises the CI XML state, not stale seed-DB state (which would roll back fields on custom content types)--kxp-ci-enable / --kxp-ci-disable / --kxp-ci-status, available from Xperience 31.6.0) — no direct SQL. The always-leave-CI-enabled safety net also uses the CLI; if the update broke badly enough that dotnet run cannot execute, the script reports it so CI can be re-enabled manually. The only remaining SQL is the CI_FileMetadata clear, which has no CLI equivalentApp_Data/CIRepository/ are expected and necessary after CI store operationKentico.Xperience.Lucene — the kenticolucene.luceneindexassemblyversionitem object type is excluded under <ExcludedObjectTypes> in src/Goldfinch.Web/App_Data/CIRepository/repository.config because it is per-environment runtime state (which assembly version built the local index) and must not flow through CI. If a file for it ever appears under App_Data/CIRepository/@global/ during an update, check the exclusion is still in place and re-run --kxp-ci-storesrc/Goldfinch.Admin/Client (contains @kentico/* packages)src/Goldfinch.Web/wwwroot/sitefiles (custom frontend, no Kentico packages)If you encounter issues:
Now, begin the update process. Start by running the PowerShell script and reporting the results.