Migrating media libraries to the content hub gives an error

2025/09/23 10:38 AM

Migrating media libraries to the content hub with the 'MigrateMediaLibrariesToContentHubTask' gives an error:

Message: 'name' is not a valid code name. (Parameter 'name')

Exception type: System.ArgumentException
Stack trace:
at CMS.ContentEngine.CreateContentFolderParameters..ctor(String displayName, String name)
at CMS.MediaLibrary.MediaFolderMigrationService.CreateFolder(String name, String displayName, Int32 parentFolderId, IContentFolderManager contentFolderManager, Nullable`1 guid, CancellationToken cancellationToken)
at CMS.MediaLibrary.MediaFolderMigrationService.RecursivelyEnsureSubfoldersStructure(MediaLibraryInfo mediaLibraryInfo, ContentFolderInfo parentFolder, String parentAssetFolderPath, IContentFolderManager contentFolderManager, IDictionary`2 folderPaths, CancellationToken cancellationToken)
at CMS.MediaLibrary.MediaFolderMigrationService.EnsureSubfoldersStructure(Dictionary`2 defaultFolders, IContentFolderManager contentFolderManager, CancellationToken cancellationToken)
at CMS.MediaLibrary.MediaFolderMigrationService.EnsureFolderStructure(Int32 userId, WorkspaceInfo workspace, CancellationToken cancellationToken)
at CMS.MediaLibrary.Internal.MigrateMediaLibrariesToContentHubTask.MigrateToContentHub(Int32 userId, CancellationToken cancellationToken)
at CMS.MediaLibrary.Internal.MigrateMediaLibrariesToContentHubTask.Execute(ScheduledTaskConfigurationInfo task, CancellationToken cancellationToken)

I already tried renaming the media library names, but I can't yet seem to find why this isn't working. Is there anyone who has already tried this functionality and has had it working?


Environment

  • Xperience by Kentico version: 30.8.2

  • .NET version: 9

Tags:
Content hub Media Library Migration / upgrade

Answers

2025/09/23 10:48 AM

Looks like it has to do something with a space in the folder name. For example the 'product brochures' subfolder is renamed with the 'GetUniqueMigrationCodename' method to: 'product brochures.migration.6'.

I did submit a support ticket for this matter, will keep this post updated.

To response this discussion, you have to login first.