Downloading Assets and Content from Contentful

If you need to export data from Contentful, the company have provided a useful CLI that you can use.

In short, you need to install that, log in, and run an export. Before you begin, though, make sure you have node and npm installed (npm will come with node when you install that).

  1. Install the CLI
> npm install -g contentful-cli
  1. Log in to Contentful
> contentful login

Follow on-screen instructions

  1. Now download the assets and data
> contentful space export --space-id your-space-id --content-only --download-assets

Replace your-space-id with the code for your space. If you haven’t seen that before, it looks a little like: z4pkem1mbtth.
4. Logout

> contentful logout

More info on command line options can be found here:

> contentful --help

The docs are pretty good, so do look in the GitHub repo, at some general information and more information on the export.


Hi! Did you find this useful or interesting? I have an email list coming soon, but in the meantime, if you ready anything you fancy chatting about, I would love to hear from you. You can contact me here or at stephen ‘at’ logicalmoon.com