In Branches, the merge operation is performed on content types and not on the entries within the content types. With the Entry Migration utility, created as part of the Entry Migration flow, you can now merge the entries along with the content types.
This step-by-step guide lets you use the Entry Migration utility to perform the merge operation on entries.
Usage
csdx cm:stacks:migration --multiple --file-path <value> --config compare-branch:<value> --branch <value> --stack-api-key <value>Options
Example
csdx cm:stacks:migration --multiple --file-path ./merge_scripts/merge_scripts_bf7xxx-xxx-xxx-xxx-xxx_xxx044 --config compare-branch:develop --branch main --stack-api-key bltxxxxxxxxxxxeAfter performing the merge operation, the merge command generates the merge scripts, and you will get the following message in your terminal:

Follow the steps below to run the migration command:
csdx cm:stacks:migration --multiple --file-path <value> --config compare-branch:<value> --branch <value> --stack-api-key <value>This runs the merge scripts, which will be used to merge the entries.
Note: You can find the error logs in the generated file path under migration-logs > error.logs. For example: ./Users/Documents/cli/packages/contentstack/migration-logs/error.logs
You can also customize the generated merge script to suit your requirements.
For example, if you want to publish the entries using the merge scripts, you can add the publish entry task as follows:
const publishEntriesTask = contentTypeUID => {
return {
title: `Publish entries for Content type '${contentTypeUID}'`,
successMessage: `Entries published successfully for '${contentTypeUID}'`,
failedMessage: `Failed to publish entries for '${contentTypeUID}'`,
task: async params => {
try {
// Add your custom logic here
} catch (error) {
console.log(error)
}
},
}
}
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"npm link marked
npm link lodash