You can use this project to export Contentful data to a JSON file. Contentful Export from https://github.com/contentful/contentful-export
-
Installation with command line:
git clone https://github.com/jasonrundell/contentful-export cd contentful-export yarn
-
Make a copy of
contentfulConfig.example.js
and rename it tocontentfulConfig.js
. -
Edit
contentfulConfig.js
and add in yourspaceId
andmanagementToken
. Changing theenvironmentId
is optional if you need to export an environment other thanmaster
or perhaps you've renamedmaster
to something else. Save file changes. -
Run the following in command line:
yarn start
-
If the export runs successfully, you should see output in yourcommand window like the following:
✔ Initialize client (1s) ✔ Fetching data from space ✔ Connecting to space (1s) ✔ Fetching content types data (1s) ✔ Fetching editor interfaces data (1s) ✔ Fetching content entries data (1s) ✔ Fetching assets data (1s) ✔ Fetching locales data (1s) ✔ Fetching webhooks data (1s) ✔ Fetching roles data (1s) ↓ Download assets [skipped] ✔ Write export log file ✔ Lookup directory to store the logs ✔ Create log directory ✔ Writing data to file ┌───────────────────────┐ │ Exported entities │ ├───────────────────┬───┤ │ Content Types │ 1 │ ├───────────────────┼───┤ │ Editor Interfaces │ 1 │ ├───────────────────┼───┤ │ Entries │ 3 │ ├───────────────────┼───┤ │ Assets │ 7 │ ├───────────────────┼───┤ │ Locales │ 2 │ ├───────────────────┼───┤ │ Webhooks │ 0 │ ├───────────────────┼───┤ │ Roles │ 0 │ └───────────────────┴───┘ The export took a few seconds (1s) Stored space data to json file at: /Users/jrundell/Documents/Github/jasonrundell/contentful-export/contentful-export-qom3enaifvoq-master-2019-09-25T10-57-72.json No errors or warnings occurred The export was successful. Your space data: