Exporting content from Wordpress, Drupal or elsewhere and importing in Contentful

Published on March 9, 2015

BlankWaves-07

Subscribe for updates

Build better digital experiences with Contentful updates direct to your inbox.

Important: The tools mentioned in this article are no longer being actively maintained.

If you're ready to leave your current CMS and move to Contentful – we’re happy to hear that. Excellent choice!

But Contentful is rarely the first content management tools our customers use. Certainly you have tons of content stored in your Wordpress or Drupal or whatever CMS you've been struggling with, and most likely you'd like to keep that content. Also, you wouldn't want to copy it manually, as this would take hours, many hours, many frustrating hours. So – we're here to help.

import export tools blog post

The tools

We've built a set of tools to assist in migrating the existing content from a CMS to Contentful. Our intention is to help you seamlessly shift to Contentful and enjoy all its benefits, whilst spending as little time as possible on setting up and diving in (not too exciting) configuration issues. These tools are:

  • The Contentful Importer, which title is as straightforward as its purpose: it imports content from appropriately structured JSONs to the Contentful database. To transform your existing content collection to a series of properly structured JSONs, use one of the exporting tools described below.

  • The Generic Database Exporter enables exporting content from any SQL database, preserving the structure and relationships between entities. This tool helps process the database output to JSON so it can be imported in Contentful. Supported databases are MySQL, Oracle, PostgreSQL, SQLite3, as well and many others.

  • The Wordpress Exporter and the Drupal Exporter process the result of the CMS default export, converting it to JSON and making it importable into Contentful.

Workflow

Anyone comfortable with the command line is skilled enough to use these tools. They are shipped as Ruby gems, making the installation a one-liner (literally). Here is a brief overview of the workflow; the detailed instructions can be found on each tool page.

Importing

In a nutshell, you'll have to provide a configuration file to let the importer know where the data is stored, how it is structured and where to upload it. The JSON describing the Contentful content model can be downloaded from the web app. Having prepared all that, you'll import the entries with one command and the assets with another.

If anything goes wrong, the results are captured in the log so you can try solving the problem yourself or provide details when contacting our support. Good thing is, the importer will not copy the same data twice.

Exporting

The process might be a bit more elaborate, but essentially it comes down to this: set up the overall configuration, describe the new content model, extract the data from the database or the CMS (depending on the data source), map the data to the new content model, create JSONs and pass all of that to the Contentful Importer. See the tool pages for detailed step-by-step instructions.

Downsides

Importing mediocre content in Contentful doesn't suddenly make it great. If the existing content is poorly structured, if the content is intermingled with styling, or if it's just plain ugly – importing it as is will retain these issues. Kind of obvious, but worth noting. However, our API-focused approach will hopefully push you to reorganize and rework the content so as to make it better from every angle.

Also worth mentioning is the effect of plugins and external modules for open-source CMSs on the database structure. The result is oftentimes dozens, a lot, great many extra tables – which make it much harder to put all the content together. If you find yourself in such a situation, be ready to spend some time on sorting out the content. We'd love to help, but since each bloated database case is different, that's beyond generic tools abilities.

Overall, these export and import tools can't solve all the problems of every content database, but they will prove useful in migrating a solidly structured content collection.

Subscribe for updates

Build better digital experiences with Contentful updates direct to your inbox.

Related articles

What is a framework? Software frameworks make programming and testing a project easier. Here's what you need to know about them and a list to choose from. 
Guides

What is a framework in programming? All about software frameworks

August 16, 2022

This post provides a high-level overview of serverless architecture, why it’s useful in your development practice, and reviews some real-world uses.
Guides

What is serverless architecture?

March 14, 2023

In this post, community contributor Dan Polant outlines some content modeling and code examples for bringing content from Contentful into your React apps.
Guides

Integrating Rich Text segments and microcopy from Contentful into your React app

July 27, 2023

Contentful Logo 2.5 Dark

Ready to start building?

Put everything you learned into action. Create and publish your content with Contentful — no credit card required.

Get started