with one click
migrate-run
// Runs the Kentico Migration Tool CLI to migrate content from KX13 to XbyK. Use when the user wants to run migration steps, execute the migration tool, or process a migration plan through the CLI.
// Runs the Kentico Migration Tool CLI to migrate content from KX13 to XbyK. Use when the user wants to run migration steps, execute the migration tool, or process a migration plan through the CLI.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | migrate-run |
| description | Runs the Kentico Migration Tool CLI to migrate content from KX13 to XbyK. Use when the user wants to run migration steps, execute the migration tool, or process a migration plan through the CLI. |
| compatibility | Requires dotnet CLI, sqlcmd, and network access to KX13 and XbyK SQL Server databases. |
| argument-hint | [migration-plan-path] |
Executes the Kentico Migration Tool CLI commands according to a migration plan — monitoring output, diagnosing errors, and applying fixes. Requires a completed migration plan, configured appsettings.json, and compiled code extensions as prerequisites.
Before running this skill, the following must already be complete:
migrate-plan skill or manually authored)migrate-appsettings skill)IClassMapping, ContentItemDirectorBase, IFieldMigration, IWidgetMigration, and IWidgetPropertyMigration implementations compiled (from the respective skills)Migration.Tool.Extensions project (and the full solution) must build without errorsBefore running any migration command, verify the environment is ready. Complete all checks in pre-flight-checks.md: locate the CLI project, validate appsettings.json (connection strings, semicolon-separated strings, QuerySourceInstanceApi reachability, MigrationProtocolPath), validate the build, check NuGet version compatibility, scan for TODO placeholders in code, and confirm pre-migration manual steps with the user. Do not proceed if any critical check fails.
From the migration plan's Execution Plan section, build a single CLI command that includes all required parameter flags. The migration tool accepts multiple flags in one invocation and executes them in the correct dependency order internally — there is no need to run steps separately or manage ordering yourself.
The standard content migration flags are:
| Flag | Purpose |
|---|---|
--sites | Create website channels (always included) |
--custom-modules | Migrate custom module classes (if applicable) |
--users | Migrate users (if applicable) |
--page-types | Create content type definitions (runs IClassMapping) |
--pages | Migrate page content, Page Builder data, attachments (runs all code extensions) |
--categories | Migrate categories as taxonomies (if applicable) |
--media-libraries | Migrate media library files (if applicable) |
--forms | Migrate online forms (if applicable) |
Default to including all standard flags unless the plan explicitly excludes them or the source definitively does not have that data type. Running a flag on empty data is harmless (the tool reports "No items to migrate"), but omitting a flag that has data causes silent data loss. If the migration plan does not mention a step, verify with the user whether it should be included rather than silently omitting it.
Example combined command:
dotnet run -- migrate --nowait --sites --custom-modules --users --page-types --pages --categories --media-libraries --forms 2>&1 | tee <protocol-dir>/migration-run.log
Tell the user which flags are included in the command, what the migration will do, and what to expect (including approximate duration).
Execute the single combined migration command using dotnet run from the CLI project directory, capturing console output to a log file:
dotnet run -- migrate --nowait --sites --custom-modules --users --page-types --pages --categories --media-libraries --forms 2>&1 | tee <protocol-dir>/migration-run.log
MigrationProtocolPath from appsettings.json. Create the folder if it doesn't exist (mkdir -p <dir>). Name the log file migration-run.log. For re-runs, append a run number: migration-run2.log, migration-run3.log.--pages and --media-libraries process large volumes of data)tee command ensures output is both displayed in real-time and saved to the log fileWatch the output for success, failure, and warning indicators. Refer to migration-tool-run-reference.md for the full output pattern reference. The tool processes each flag sequentially within the single run and reports progress for each.
If the run fails at any point, analyze the error output and apply the appropriate fix from migration-tool-run-reference.md.
After applying a fix:
dotnet build)--bypass-dependency-check appended (steps that already completed will be skipped or updated idempotently):dotnet run -- migrate --nowait --sites --custom-modules --users --page-types --pages --categories --media-libraries --forms --bypass-dependency-check 2>&1 | tee <protocol-dir>/migration-run2.log
If the fix doesn't resolve the issue after one re-run, check both the saved console log in the protocol log directory and the migration tool's own log file at logs/log.txt (relative to the CLI project directory; configured by Logging.pathFormat in appsettings.json) for more detail. After two failed attempts, present findings to the user and ask for guidance rather than continuing to retry.
After the run completes, record:
After the migration run succeeds, run all validation queries from post-step-validation.md against the XbyK database using sqlcmd. Cross-reference results against the migration plan and flag any discrepancies (missing types, orphan pages, missing taxonomies).
After all steps complete, present a summary table:
| Flag | Result | Notes |
|---|---|---|
--sites | Success | Site MedioClinic created |
--custom-modules | Success | Airports module migrated |
--users | Success | 12 users migrated |
--page-types | Success | 8 content types created |
--pages | Success | 245 pages migrated, 3 warnings |
| ... | ... | ... |
Then list:
--bypass-dependency-check appended--pages and --media-libraries are typically the slowest.Settings.MigrationProtocolPath. This is non-negotiable — logs are essential for post-mortem analysis and migrate-eval.logs/log.txt in the CLI project directory; configured by Logging.pathFormat in appsettings.json).ConvertClassesToContentHub must be a semicolon-separated string, not a JSON array. This is the most common configuration error — the tool throws InvalidOperationException at startup. Same applies to CreateReusableFieldSchemaForClasses.migrate verb is required before any parameter flags — dotnet run -- --sites won't work, it must be dotnet run -- migrate --sites.CMSDBVersion from CMS_SettingsKey to verify.--bypass-dependency-check — on re-runs, append --bypass-dependency-check to the same combined command. Without it, the tool refuses to run steps whose dependencies it thinks haven't completed (even though they have from the prior run).FormatException — replace with Guid.Empty (00000000-0000-0000-0000-000000000000) as safe defaults before running.QuerySourceInstanceApi silently blocks --pages if the KX13 instance is unavailable — disable it in appsettings to fall back to legacy widget migration.--nowait flag (e.g., dotnet run -- migrate --nowait ...) to suppress this prompt so the process exits without blocking.