Was this article helpful?
Thanks for your feedback
In this section, we'll cover the exporter tools that have been built to assist our customers who plan to migrate their existing content from Drupal to Contentstack. By the end of this section, you will be able to perform the migration of your content into Contentstack in an efficient manner.
The export tool allows you to export content from Drupal using MySQL queries and makes it possible to import it into Contentstack. Using this project, you can easily export Content types (Article, Page, and Custom content types), Users, Tags, and Vocabularies from Drupal that can be later imported into Contentstack.
To do so, you need to perform the steps given below:
To install the node modules that are necessary for exporting the content into your file system, open a terminal, navigate to the root folder of the exporter utility tool, and run the command given below:
npm install
"host":"<<mysql host>>", "user":"<<mysql username>>", "password":"<<mysql password>>", "database":"<<mysql database of Drupal>>"
In the above configuration details, you need to provide the MySQL host, username, and password, and also provide the name of the Drupal database content.
Next, your files and assets need to be available and accessible through the internet. For this purpose, you must define a key named 'drupal_base_url' in the 'index.json' file for the exporter to create it.
drupal_base_url: http://example_hostname.com
Also, in order to be able to properly map the Drupal content types to the Contentstack content types, their names should be identical. For example: if the name of a content type in Drupal is 'Blog', then the name of content type in Contentstack should be 'Blog' too.
npm run export
This command will extract data of authors, assets, categories, and posts from the downloaded XML file and convert them in JSON files that is supported in Contentstack. These files are stored in the path mentioned in the 'data' key in the 'config/index.js' file.
npm run export {module-name}
When exporting modules individually, make sure you follow the module sequence as given below, for example, before exporting posts, you must have had exported assets and authors:
Now, to export the modules, you need to provide the absolute path of the file that stores the IDs, when running the following command in a terminal:
npm run export <<module name>>
You can find the 'success' and 'error' logs of the export process under libs/utils/logs. The successfully run processes are recorded under 'success' and the processes that face errors will be recorded under 'errors'.
The logs for failed assets are recorded in 'failed.json' and is stored under the 'master' folder located where your exported data resides.
Note: The exporter utility tool can be used to extract only the latest published version of an entry.
The latest published content will be exported in JSON format and stored at the location provided in the 'index.json' configuration file from where you can later import the data into Contentstack.
This utility supports data migration from Drupal 8 to Contentstack. For migrating the content from Drupal 8 to Contentstack, the procedure remains the same. However, in the following table, we have listed features and fields that are supported (and not supported) for Drupal 8 migration:
Fully Supported Fields | Partially Supported Fields | Not Supported Fields |
text | taxonomy_term_reference | reference |
text-long | image inside text_long | |
file | configuration option | |
image | user/roles | |
date | ||
integer | ||
list_boolean | ||
text_with_summary |
In the above table:
Some of the limitations of the utility include the following:
Now, refer the next section to learn how to import the exported content into Contentstack.
The exported content is now ready to be imported into Contentstack. This content will be in JSON format and stored at the location provided in the 'index.json' configuration file from where you can later import the data into Contentstack.
To import the content, follow the steps mentioned in the Import Content into Contentstack document.
Was this article helpful?
Thanks for your feedback