With the Taxonomy Migration utility, you can import the taxonomies and respective terms using a CSV file created using one of the following methods:
This step-by-step guide lets you use the Taxonomy Migration utility to perform the taxonomy migration operation on a stack.
Note: If you are using a CSV template to generate the CSV file, the Taxonomy Name and Term Level* Name fields are mandatory.
Additional Resource: Here is a sample script to import taxonomies into your stack. Preferably, use this sample script to try out the commands in this guide.
Usage
csdx cm:stacks:migration --file-path <value> --config data-dir:<value> --stack-api-key <value>Options
Tip: Preferably, use the sample taxonomy migration script to import taxonomies.
Example
Without delimiter:
csdx cm:stacks:migration -k b*******9ca0 --file-path "../contentstack-migration/examples/taxonomies/import-taxonomies.js" --config data-dir:'./data/Taxonomy Stack_taxonomies.csv'Note: For Windows OS, use "\" instead of "/" for paths.
With delimiter (Mac OS):
csdx cm:stacks:migration -k b*******9ca0 --file-path "../contentstack-migration/examples/taxonomies/import-taxonomies.js" --config {data-dir:'./data/Taxonomy Stack_taxonomies.csv',delimiter:'|'}With delimiter (Windows OS):
csdx cm:stacks:migration -k b*********d4 --file-path "C:\Users\v***h\Desktop\Contentstack\CLI\Taxonomy\import-taxonomies.js" --config data-dir:'C:\Users\v***h\Desktop\Contentstack\CLI\Taxonomy\test_taxonomies.csv' delimiter:','Follow the steps below to run the taxonomy migration command:
Note: Provide the file path of the downloaded sample script.
Note: You must provide a delimiter in config only if you used a delimiter while exporting taxonomies to CSV or generating CSV file manually.
csdx cm:stacks:migration --stack-api-key <value> --file-path <value> --config {data-dir:<value>,delimiter:<value>}Note: For Windows OS, use ',' as the delimiter.
You have successfully migrated taxonomies from your CSV file to the provided stack.
Without delimiter:

With delimiter (Windows OS):

With delimiter (Mac OS):

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 fast-csv