Skip to content
This repository was archived by the owner on Dec 17, 2025. It is now read-only.

A node.js utility to export data from Drupal SQL database and convert it into the format that contentstack-import utility can use to import content in Contentstack.

Notifications You must be signed in to change notification settings

contentstack/drupal-sql-to-contentstack-exporter

Repository files navigation

Warning

This repo is deprecated and no longer maintained. Security updates are not supported. We recommend avoiding its use.

Content migration from Drupal

Built.io Contentstack is a headless CMS with an API-first approach that puts content at the centre. It is designed to simplify the process of publication by separating code from content.

This project (export script) allows you to export content from a Drupal using MySQL queries and makes it possible to import it into Built.io Contentstack. Using this project, you can easily export Drupal Content types ( Article, Page, Custom content types) Users, Tags, and Vocabularies, into Built.io Contentstack.

Installation

Download this project and run the command given below in a terminal:

npm install

This command will install the required node files on your system.

Configuration

Before exporting the data, you need to add the following configuration settings in the 'config' file within the 'config' folder of the project:

"host":"<<mysql host>>",
"user":"<<mysql username>>",
"password":"<<mysql password>>",
"database":"<<mysql database of drupal>>,
"data":"<<folder path for data to be exported>>"

Assets & Images

Your files and assets need to be available and accessible through the internet. For this purpose, you must define the drupal_base_url, public and private file path in the config file so that the exporter will be able to create them.

base_url: http://example_hostname.com
public_path: <<public file path>>
private_path: <<private file path>>

Content Types

To be able to properly map the Drupal content types to the Contentstack content types they must be identical by name.

Export modules

After adding settings, you need to export modules. You can either add all modules or only specific modules to suit your requirements.

Note: Before exporting any other module first you need to export query module.

Run the command given below to generate mysql query:

 npm run export query

Export all modules

Run the command given below to export all the modules:

 npm run export

Export specific modules

Run the command given below to export specific modules:

 npm run export <<module name>>

For example, the sequence of module names to be exported can be as follows:

  1. query
  2. contenttypes
  3. assets
  4. authors
  5. vocabulary
  6. taxonomy
  7. page

Import content

Now, give the exported 'data' folder path in 'config/index.js' file and run the contentstack-importer script to import the content to Built.io Contentstack.

Afterthat run the contentstack-importer script to import the content to Built.io Contentstack.

Log

You can find the logs of the export process under libs/utils/logs. The files included are 'success' and 'error'. Successfully run processes are recorded under 'success' and the errors under 'errors'.

Known issues

  1. The internal links will not be updated.
  2. Only supported for Drupal 8.

License

This project is covered under the MIT license.

About

A node.js utility to export data from Drupal SQL database and convert it into the format that contentstack-import utility can use to import content in Contentstack.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 6