contentful-cli
contentful-cli copied to clipboard
Cannot export specified content type with CLI Export
Expected Behavior
After running the export query on the CLI, only the Content Types specified in the field queryEntries in the config file should be fetched.
Actual Behavior
Follow up on #1468.
user@MacBook-Pro ~ % contentful space export --config "cli-config.json"
✔ Initialize client (1s)
✔ Fetching data from space
✔ Connecting to space (1s)
✔ Fetching content types data (2s)
✔ Fetching tags data (1s)
✔ Fetching editor interfaces data (4s)
✔ Fetching content entries data (2s)
✔ Fetching assets data (1s)
✔ Fetching locales data (1s)
↓ Fetching webhooks data [skipped]
→ Webhooks can only be exported from master environment
↓ Fetching roles data [skipped]
→ Roles can only be exported from master environment
↓ Download assets [skipped]
✔ Write export log file
✔ Lookup directory to store the logs
✔ Create log directory
✔ Writing data to file
┌─────────────────────────┐
│ Exported entities │
├───────────────────┬─────┤
│ Content Types │ 11 │
├───────────────────┼─────┤
│ Tags │ 7 │
├───────────────────┼─────┤
│ Editor Interfaces │ 11 │
├───────────────────┼─────┤
│ Entries │ 374 │
├───────────────────┼─────┤
│ Assets │ 226 │
├───────────────────┼─────┤
│ Locales │ 3 │
└───────────────────┴─────┘
Steps to Reproduce
I find myself having the same issue. It downloads all content types instead of just 'convertTest' type
"spaceId": "space-id",
"environmentId": "environment",
"managementToken": "CFPAT-token",
"exportDir": "./",
"saveFile": true,
"contentFile": "export.json",
"includeDrafts": false,
"includeArchived": false,
"skipContentModel": false,
"skipContent": false,
"skipRoles": false,
"skipWebhooks": false,
"contentOnly": false,
"queryEntries": ["content_type=convertTest"],
"downloadAssets": false,
"host": "api.contentful.com",
"maxAllowedLimit": 1000,
"errorLogFile": "./error.log",
"useVerboseRenderer": false
}
Environment
Node Version: v18.7.0 Npm Version: 8.15.0 Operating System: macOS 12.4 (21F79) Monterey Package Version: [email protected]
+1 I am experiencing this issue as well
I should probably add or change the text to:
"queryEntries"
doesn't actually filter anything. e.g.
"queryEntries": ["sys.id=8Dos2GgHE0uTZJR6SIqOaX"],
still returns all content
+1
+1, there's not even a single example on the documentation on how should we query using the query-entries.
See following links with the syntax for querying and search API documentation:
- https://github.com/contentful/contentful-export#querying
- https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters
Related to #173.
+1
I was able to filter two content types with:
"queryEntries": ["sys.contentType.sys.id[in]=contentTypeOne,contentTypeTwo"],
a working answer has been provided, will close this for now