{"id":14008569,"url":"https://github.com/contentful/contentful-export","last_synced_at":"2026-02-27T19:50:21.981Z","repository":{"id":9333904,"uuid":"61539828","full_name":"contentful/contentful-export","owner":"contentful","description":"This tool allows you to export a Contentful space to a JSON dump","archived":false,"fork":false,"pushed_at":"2025-04-03T00:19:49.000Z","size":108984,"stargazers_count":166,"open_issues_count":16,"forks_count":74,"subscribers_count":58,"default_branch":"main","last_synced_at":"2025-04-06T05:38:21.318Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/contentful.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-20T10:43:17.000Z","updated_at":"2025-04-03T00:17:08.000Z","dependencies_parsed_at":"2023-10-17T05:55:50.028Z","dependency_job_id":"80c281b7-60d9-4f58-b269-2f0f66a2dfec","html_url":"https://github.com/contentful/contentful-export","commit_stats":{"total_commits":1595,"total_committers":46,"mean_commits":34.67391304347826,"dds":0.4263322884012539,"last_synced_commit":"4a40bc2ada13e75b349e9236f4644cd0df22528e"},"previous_names":[],"tags_count":561,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentful%2Fcontentful-export","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentful%2Fcontentful-export/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentful%2Fcontentful-export/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentful%2Fcontentful-export/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/contentful","download_url":"https://codeload.github.com/contentful/contentful-export/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247517907,"owners_count":20951718,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-10T11:01:50.222Z","updated_at":"2026-02-27T19:50:21.974Z","avatar_url":"https://github.com/contentful.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Contentful export tool\n\n[![CI](https://github.com/contentful/contentful-export/actions/workflows/main.yaml/badge.svg)](https://github.com/contentful/contentful-export/actions/workflows/main.yaml)\n[![npm](https://img.shields.io/npm/v/contentful-export.svg)](https://www.npmjs.com/package/contentful-export) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\n[Contentful](https://www.contentful.com) provides a content infrastructure for digital teams to power content in websites, apps, and devices. Unlike a CMS, Contentful was built to integrate with the modern software stack. It offers a central hub for structured content, powerful management and delivery APIs, and a customizable web app that enable developers and content creators to ship digital products faster.\n\nThis is a library that helps you backup your Content Model, Content and Assets or move them to a new Contentful space. _It will support Roles \u0026 Permissions in a future version._\n\nTo import your exported data, please refer to the [contentful-import](https://github.com/contentful/contentful-import) repository.\n\n## :exclamation: Usage as CLI\n\n\u003e We moved the CLI version of this tool into our [Contentful CLI](https://github.com/contentful/contentful-cli). This allows our users to use and install only one single CLI tool to get the full Contentful experience.\n\u003e\n\u003e Please have a look at the [Contentful CLI export command documentation](https://github.com/contentful/contentful-cli/tree/master/docs/space/export) to learn more about how to use this as command line tool.\n\n## :cloud: Pre-requisites \u0026\u0026 Installation\n\n### Pre-requisites\n\n- Node LTS\n\n### :cloud: Installation\n\n```bash\nnpm install contentful-export\n```\n\n## :hand: Usage\n\n### CommonJS\n\n```javascript\nconst contentfulExport = require('contentful-export')\n\nconst options = {\n  spaceId: '\u003cspace_id\u003e',\n  managementToken: '\u003ccontent_management_api_key\u003e',\n  ...\n}\n\ncontentfulExport(options)\n  .then((result) =\u003e {\n    console.log('Your space data:', result)\n  })\n  .catch((err) =\u003e {\n    console.log('Oh no! Some errors occurred!', err)\n  })\n```\n\n### ESM\n\n```javascript\nimport contentfulExport from 'contentful-export'\n\nconst options = {\n  spaceId: '\u003cspace_id\u003e',\n  managementToken: '\u003ccontent_management_api_key\u003e',\n  ...\n}\n\n// contentfulExport returns a Promise so you can use async/await, etc.\nawait contentfulExport(options)\n```\n\n### Querying\n\nTo scope your export, you are able to pass query parameters. All search parameters of our API are supported as documented in our [API documentation](https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters).\n\n```javascript\nconst contentfulExport = require('contentful-export')\n\nconst options = {\n  spaceId: '\u003cspace_id\u003e',\n  managementToken: '\u003ccontent_management_api_key\u003e',\n  queryEntries: ['content_type=\u003ccontent_type_id\u003e']\n}\n\ncontentfulExport(options)\n...\n```\n\nThe Export tool also support multiple inline queries.\n\n```javascript\nconst contentfulExport = require('contentful-export')\n\nconst options = {\n  spaceId: '\u003cspace_id\u003e',\n  managementToken: '\u003ccontent_management_api_key\u003e',\n  queryEntries: [\n    'content_type=\u003ccontent_type_id\u003e',\n    'sys.id=\u003centry_id\u003e'\n  ]\n}\n\ncontentfulExport(options)\n...\n```\n\n`queryAssets` uses the same syntax as `queryEntries`\n\n### Export an environment\n\n```javascript\nconst contentfulExport = require('contentful-export')\n\nconst options = {\n  spaceId: '\u003cspace_id\u003e',\n  managementToken: '\u003ccontent_management_api_key\u003e',\n  environmentId: '\u003cenvironment_id\u003e'\n}\n\ncontentfulExport(options)\n...\n```\n\n## :gear: Configuration options\n\n### Basics\n\n#### `spaceId` [string] [required]\n\nID of the space with source data\n\n#### `environmentId` [string] [default: 'master']\n\nID of the environment in the source space\n\n#### `managementToken` [string] [required]\n\nContentful management API token for the space to be exported\n\n#### `deliveryToken` [string]\n\nContentful Content Delivery API (CDA) token for the space to be exported.\n\nProviding `deliveryToken` will export both entries and assets from the\nContentful Delivery API, instead of the Contentful Management API.\nThis may be useful if you want to export the latest _published_ versions,\nas the management API always only exports the entirety of items, with the latest\nunpublished content. So if you want to make sure only to see the latest\npublished changes, provide the `deliveryToken`.\n\nJust to clarify: When Contentful Management API always returns the latest version (e.g. 50 in this case):\n\n```\n  \"createdAt\": \"2020-01-06T12:00:00.000Z\",\n  \"updatedAt\": \"2020-04-07T11:00:00.000Z\",\n  \"publishedVersion\": 23,\n  \"publishedAt\": \"2020-04-05T14:00:00.000Z\",\n  \"publishedCounter\": 1,\n  \"version\": 50,\n```\n\nthe Content Delivery API would return the `publishedVersion` (23). CDA responses don't include\nversion number.\n\nNote: Tags are only available on the Contentful Management API, so they will not be exported if you provide a Contentful Delivery Token. Tags is a new feature that not all users have access to.\n\n### Output\n\n#### `exportDir` [string] [default: current process working directory]\n\nDefines the path for storing the export JSON file\n\n#### `saveFile` [boolean] [default: true]\n\nSave the export as a JSON file\n\n#### `contentFile` [string]\n\nThe filename for the exported data\n\n### Filtering\n\n#### `includeDrafts` [boolean] [default: false]\n\nInclude drafts in the exported entries.\n\nThe `deliveryToken` option is ignored\nwhen `includeDrafts` has been set as `true`.\nIf you want to include drafts, there's no point of getting them through the\nContent Delivery API.\n\n#### `includeArchived` [boolean] [default: false]\n\nInclude archived entries in the exported entries\n\n#### `skipContentModel` [boolean] [default: false]\n\nSkip exporting content models\n\n#### `skipEditorInterfaces` [boolean] [default: false]\n\nSkip exporting editor interfaces\n\n#### `skipContent` [boolean] [default: false]\n\nSkip exporting assets and entries.\n\n#### `skipRoles` [boolean] [default: false]\n\nSkip exporting roles and permissions\n\n#### `skipTags` [boolean] [default: false]\n\nSkip exporting tags\n\n#### `skipWebhooks` [boolean] [default: false]\n\nSkip exporting webhooks\n\n#### `stripTags` [boolean] [default: false]\n\nUntag assets and entries\n\n#### `contentOnly` [boolean] [default: false]\n\nOnly export entries and assets\n\n#### `queryEntries` [array]\n\nOnly export entries that match these queries\n\n#### `queryAssets` [array]\n\nOnly export assets that match these queries\n\n#### `downloadAssets` [boolean]\n\nDownload actual asset files\n\n### Connection\n\n#### `host` [string] [default: 'api.contentful.com']\n\nThe Management API host\n\n#### `hostDelivery` [string] [default: 'cdn.contentful.com']\n\nThe Delivery API host\n\n#### `proxy` [string]\n\nProxy configuration in HTTP auth format: `host:port` or `user:password@host:port`\n\n#### `rawProxy` [boolean]\n\nPass proxy config to Axios instead of creating a custom httpsAgent\n\n#### `maxAllowedLimit` [number] [default: 1000]\n\nThe number of items per page per request\n\n#### `headers` [object]\n\nAdditional headers to attach to the requests.\n\n### Other\n\n#### `errorLogFile` [string]\n\nFull path to the error log file\n\n#### `useVerboseRenderer` [boolean] [default: false]\n\nDisplay progress in new lines instead of displaying a busy spinner and the status in the same line. Useful for CI.\n\n## :rescue_worker_helmet: Troubleshooting\n\n### Proxy\n\nUnable to connect to Contentful through your proxy? Try to set the `rawProxy` option to `true`.\n\n```javascript\ncontentfulExport({\n  proxy: 'https://cat:dog@example.com:1234',\n  rawProxy: true,\n  ...\n})\n```\n\n### Error: 400 - Bad Request - Response size too big.\n\nContentful response sizes are limited (find more info in our [technical limit docs](https://www.contentful.com/developers/docs/technical-limits/)). In order to resolve this issue, limit the amount of entities received within a single request by setting the [`maxAllowedLimit`](#maxallowedlimit-number-default-1000) option:\n\n```javascript\ncontentfulExport({\n  proxy: 'https://cat:dog@example.com:1234',\n  rawProxy: true,\n  maxAllowedLimit: 50\n  ...\n})\n```\n\n### Embargoed Assets\n\nIf a space is configured to use the [embargoed assets feature](https://www.contentful.com/help/media/embargoed-assets/), certain options will need to be set to use the export/import tooling. When exporting content, the `downloadAssets` option must be set to `true`. This will download the asset files to your local machine. Then, when importing content ([using `contentful-import`](https://github.com/contentful/contentful-import)), the `uploadAssets` option must be set to `true` and the `assetsDirectory` must be set to the directory that contains all of the exported asset folders.\n\n```javascript\nconst contentfulExport = require(\"contentful-export\");\n\nconst options = {\n  spaceId: \"\u003cspace_id\u003e\",\n  managementToken: \"\u003ccontent_management_api_key\u003e\",\n  downloadAssets: true,\n};\n\ncontentfulExport(options);\n```\n\n## :card_file_box: Exported data structure\n\nThis is an overview of the exported data:\n\n```json\n{\n  \"contentTypes\": [],\n  \"entries\": [],\n  \"assets\": [],\n  \"locales\": [],\n  \"tags\": [],\n  \"webhooks\": [],\n  \"roles\": [],\n  \"editorInterfaces\": []\n}\n```\n\n_Note:_ Tags feature is not available for all users. If you do not have access to this feature, the tags array will always be empty.\n\n## :warning: Limitations\n\n- This tool currently does **not** support the export of space memberships.\n- Exported webhooks with credentials will be exported as normal webhooks. Credentials should be added manually afterwards.\n- If you have custom UI extensions, you need to reinstall them manually in the new space.\n\n## :memo: Changelog\n\nRead the [releases](https://github.com/contentful/contentful-export/releases) page for more information.\n\n## :scroll: License\n\nThis project is licensed under MIT license\n\n[1]: https://www.contentful.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontentful%2Fcontentful-export","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcontentful%2Fcontentful-export","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontentful%2Fcontentful-export/lists"}