Contentful logo

Contentful Community

Issues with the contentful migration CLI

I am having issues with the contentful migration cli tool. When I run the tool with the angry-dog.js I get the following:

TypeError: Expected parameter accessToken
at createClient
(/usr/local/lib/node_modules/contentful-cli/node_modules/contentful-migration/node_modules/contentful-management/dist/contentful-management.node.js:25…
at Object.createManagementClient
(/usr/local/lib/node_modules/contentful-cli/node_modules/contentful-migration/built/bin/lib/contentful-client/index.js:47:12)
at run (/usr/local/lib/node_modules/contentful-cli/node_modules/contentful-migration/built/bin/cli.js:42:40)
at exports.migration (/usr/local/lib/node_modules/contentful-cli/dist/cmds/space_cmds/migration.js:82:28)
at

However my command line seems valid (not I used both short and. long option names to the same effect):
contentful space migration -a af5XXXXXXXXXXXXXXXXXXXXXXXXXXc1 -s 2XXXXXXXX0 angry-dog.js

Is there something else I need to besides install the tool with: npm install -g contentful-cli ?

Thanks

Hi @steve.ratay!

For the migration cli you should use your Contentful Personal Access Token. It’ll start with CFPAT-.

Or you could just run

contentful login

which will open a web browser and generate an OAuth2 token for your contentful-cli tool to use. Just click the authorize button and then you can run your migration command without the access token parameter:

contentful space migration -s 2XXXXXXXX0 angry-dog.js

Hope this helps!!!