Media Library Migration

Are images added in Rich Text editor fields on Page Builder widgets handled in the Media Library Migration?

Luckily for most projects we've used the Content Hub for media asset storage, but we've noticed on a project after running the media library migration that URLs stored within RTE fields on widgets are not handled.

Is this correct? The documentation seems to imply that, but then doesn't have a solution.

I guess we need to run a one off migration ourselves to correct data?

References to media files in Page Builder and Email Builder are not migrated and need to be recalculated using the Track missing content item usages scheduled task.

I think this part of the documentation is slightly confusing because it kind of implies that the scheduled task will fix it 🤯

Tags:
Media Library Migration / upgrade
0

Answers

"References" in this case is the data that populated the "Used in" tab for reusable content items and web pages.

Running the scheduled task will re-execute the "extraction" logic for non-structured data so Xperience can track usages of content in those sources of content - e.g. rich text.

1

I think the documentation should make it clear that there is additional steps required for cleaning up rich text fields.

I have done this in my project now using Claude Code to generate a one time migration script, and it worked fine, but it would have been good to know up front the migration tool doesn't do this

1

Yes, that's spot on - Liam's response clarifies that the scheduled task only re-scans RTE content to populate usage tracking data (like "Used in" tabs), but doesn't rewrite the actual HTML URLs in rich text fields.​

Confirming the Gap

Your experience matches the docs exactly: RTE embedded media URLs (e.g., /getmedia/{guid}/... in widget HTML) aren't touched by the field migration tool or redirects if they're non-standard. The task handles detection, not correction, which is why broken links persist until manual cleanup.​

Practical Next Steps

  • Run the task post-migration to ensure tracking is accurate.

  • Use a custom script (like your Claude-generated one) for bulk URL replacement target PageBuilderWidgetContent or content item RTE fields via IContentItemManager.

  • Test redirects first on a backup; since GUIDs are preserved, most /getmedia/ → /getcontentasset/ swaps work seamlessly.

0

Feel free to use my logic in my GitHub - KenticoDevTrev/XperienceCommunity.MediaLibraryMigrationToolkit: Helps migrate media library files off of database/on premise file storage and onto cloud storage (azure blob storage).

In it I have logic to take a string and find and replace any getmedia, getattachment, and even relative paths and replace them. It's not updated for the Content Hub mind you, but you can use the same logic in yours.

The basic idea is this though:

  1. Define what tables and columns may contain media links
  2. Define existing media links ("From" url and "to" url)
  3. Grab ALL the data for each table, and for each column use regex to find possible media links that need to be converted
  4. Look up existing media links "From" and replace with "to" url
  5. Use a simple "Update [table] set [column] = @newValue where [TableIdColumn] = @id" to update the values directly in the database for speed.

This file has the regex examples:

XperienceCommunity.MediaLibraryMigrationToolkit/KX12/XperienceCommunity.MediaLibraryMigrationToolkit.KX12.Admin/Helpers/MediaLibraryMigrationScanner.cs at master · KenticoDevTrev/XperienceCommunity.MediaLibraryMigrationToolkit · GitHub

0

To response this discussion, you have to login first.