Community Articles Importing Data from Contentful to Cosmic JS

Importing Data from Contentful to Cosmic JS

Greener pastures await. Photo by Kalen Emsley on Unsplash.

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


Cosmic JS allows you to easily create nested structures and upload media files. We learn how nested structures are built and how you can fetch such data from Cosmic JS API to use in a simple music site app.
In this video, Cosmic JS co-founder Tony Spiro takes you on a tour of the new Cosmic CLI which allows you to do all of the awesome things you can with the Cosmic JS API, from the comfort of your command line interface.
Website built using the Next.js Website Boilerplate. Fully responsive down to mobile, SEO ready, includes a contact form and full site search.
Cosmic Community Member Reagan McFarland just debuted the new Alexa Skill codebase to add Objects to your Cosmic JS Bucket via voice. In this video, Cosmic JS co-founder Tony Spiro takes you on a quick tour of how to demo the Alexa To Do app from the Alexa developer console.
In this tutorial, Cosmic JS co-founder Tony Spiro shows you how to quickly and easily add dynamic content to your Next.js app.
This is a quick example to show some of the powerful things you can do with the Cosmic JS NPM Module. This script will, add a Bucket to your Cosmic JS account, add an Object Type (Pages) and add a few Pages.

Ready to Get Started?

No payment info required.
Start Now   Contact Sales