When importing data via Contentstack's CLI, if some of the reference UIDs of assets, entries, or extensions in the destination stack are not updated within the entries. This can result in those entries not displaying correctly, potentially affecting functionalities that depend on them.
To resolve this, you can use the script 05-Update-reference-entry-from-mapper to update the references. This script can be used under the following conditions:
This step-by-step guide lets you update the missing reference UIDs of entries, assets, and extensions in CLI.
Follow the steps below to update the missing reference UIDs:
cd <path-to-examples>
{
"mapper-path": "<path>/_backup_<number>/",
"contentTypes": [
"ct1",
"ct2", ....
]
}csdx cm:stacks:migration --file-path ./05-Update-reference-entry-from-mapper.js --config-file ./config.json -k <stack_ApiKey>If you are facing a Migration Unsuccessful or Module cannot be found error, please try one of the following troubleshooting methods:
FOR /F "usebackq tokens=*" %i IN (`npm root -g @contentstack/cli`) DO SET NODE_PATH=%i/@contentstack/cli/node_modulesforeach ($i in $(npm root -g @contentstack/cli)) { $env:NODE_PATH = "$i/@contentstack/cli/node_modules" }export NODE_PATH="$(npm root -g @contentstack/cli)/@contentstack/cli/node_modules"