Importing Data from Contentful to Cosmic JS


Using the Cosmic JS Contentful Importer to transfer your data from Contentful is extremely easy and only takes a few minutes! For a walkthrough of how I built the Contentful Importer check out my other article, Creating the Cosmic JS Contentful Importer.

First head to Contentful Importer Extension and click the "Select Extension" button:


From there select the bucket you would like to add the extension to. 

After selecting the bucket you will see the Contentful Importer extension in the left sidebar:


Now to export your data from Contentful! The first thing you'll need to do is export data using the contentful-cli. Contentful has a full walkthrough on installing the CLI here and here, and a walkthrough on exporting your data here

To install the contentful cli you can use homebrew, NPM or yarn:

# homebrew
brew install contentful-cli

# npm
npm install -g contentful-cli

#yarn
yarn global add contentful-cli


Next you'll need to authenticate the CLI app with your account:

$ contentful login


After opening your browser you'll be prompted to login to Contentful then you'll be provided with a token:


Finally, copy the token and paste it into the contentful login prompt in your console. 


Now you can generate the Contentful export: 

$ contentful space export --space-id=[Your space ID] 


The export tool will run and produce a JSON file. 


Go back to your space and upload the JSON file in the Contentful Importer extension page and click "Run import":


Congratulations! You've successfully migrated your data from Contentful to Cosmic JS!

Was this article helpful?

Thank you! Your input helps us improve our articles and resources. If you have any other questions or comments, please contact support.

You may also like


Exporting Cosmic JS-powered data to CSV is easy with this new extension šŸš€
Here I am going to explain the complete process to implement an Angular 6 blog, which uses Cosmic JS as back-end.
We recently released Cosmic Functions (public beta). We're excited to help teams build amazing modern products together with new serverless solutions.
In addition to Import / Export Features and Revision History, Cosmic JS has added Automatic Bucket Backups to deliver even more peace of mind to you and your content editing team. To add daily Backups to your Buckets go to Your Bucket Dashboard > Settings > Backups.
In this article Iā€™m going demonstrate how to add new form submissions to Hubspot when you Publish Objects in your Cosmic JS Bucket.
In this blog we'll quickstart a React ToDo App using the Cosmic JS CLI. This is a simple todo application that consumes the Cosmic JS API and is built using React, Redux, Node.js and Webpack.