A Contentful content management token: you can create one under Settings > API keys > Content management tokens and then clicking the Generate personal token button:
Your DatoCMS full-access API token: create a new project, and then head to Settings > API tokens:
To import all the entries and assets of your Contentful space into DatoCMS, run the following in the console, making sure to replace the placeholder values with the tokens and IDs of your project:
datocms contentful:import --api-token=<apiToken> --contentful-token=<apiToken> --contentful-space-id=<spaceId>
The required parameters are these:
--api-token=<value> Your DatoCMS project read-write API token--contentful-space-id=<value> Your Contentful space ID--contentful-token=<value> Your Contentful read-write API token
The tool also accepts some additional advanced options:
--autoconfirm Automatically enter an affirmative response to all confirmationprompts, enabling the command to execute without waiting for userconfirmation, like forcing the destroy of existing Contentful schemamodels.--concurrency=<value> [default: 15] Specify the maximum number of operations to be runconcurrently--config-file=<value> [default: ./datocms.config.json] Specify a custom config file path--contentful-environment=<value> The environment you want to work withtoken--ignore-errors Ignore errors encountered during import--log-level=(NONE|BASIC|BODY|BODY_AND_HEADERS) Level of logging for performed API calls--only-content-type=<value> Exclusively import the specified content types. Specify the contenttypes you want to import with comma separated Contentful IDs -Example: blogPost,landingPage,author--profile=<value> Use settings of profile in datocms.config.js--skip-content Exclusively import the schema (models) and ignore records and assets
Although highly compatible, there are some minor differences between the types of fields that Contentful offers compared to DatoCMS, so the tool will follow the following migration rules:
DatoCMS doesn't provide an array of strings field, so data of this kind will be converted in a single string field with comma separated values;
Contentful API doesn't expose presentation settings for fields, so all text fields will be set as Markdown editors (you will be able to change the presentation mode later from the DatoCMS interface);
DatoCMS doesn't allow a multi-paragraph text field to be the Model title, so if that's the case, no title field will be set;