-
Notifications
You must be signed in to change notification settings - Fork 8
Description
The sitecore migration seems to have issues on Windows due to incorrect file separator being used. When going from step 2 (Configure Destination Stack) to Step 3 (Map Content Fields), the migration tools shows that there are no Content Types available while in fact there are.
The tool has been run on two different Windows machines, both using Windows Terminal and PowerShell 7.
The console log of the upload-api application shows the following error:
🚀 ~ createSitecoreMapper ~ err: TypeError: Cannot read properties of undefined (reading '$')
at createTemplate (C:\repos\sandbox\migration-v2\upload-api\migration-sitecore\libs\contenttypes.js:26:19)
at singleContentTypeCreate (C:\repos\sandbox\migration-v2\upload-api\migration-sitecore\libs\contenttypes.js:648:20)
at C:\repos\sandbox\migration-v2\upload-api\migration-sitecore\libs\contenttypes.js:687:7
at Array.forEach (<anonymous>)
at ExtractContentTypes (C:\repos\sandbox\migration-v2\upload-api\migration-sitecore\libs\contenttypes.js:686:13)
at C:\repos\sandbox\migration-v2\upload-api\build\controllers\sitecore\index.js:68:15
at Generator.next (<anonymous>)
at fulfilled (C:\repos\sandbox\migration-v2\upload-api\build\controllers\sitecore\index.js:5:58)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
{"level":"warn","message":"Validation error: File validation failed.","status":401,"timestamp":"2025-07-07T09:10:23.490Z"}
I have traced this back to the function ExtractContentTypes in upload-api/migration-sitecore/libs/contenttypes.js where a path split is done on line 680 where a forward slash is used instead of a backward slash.
Suggestions is to use Node's path.sep to get the correct file separator depending on the platform where the tool is run.