This repository serves as a practical guide on utilizing the Contentful CLI Tool for various common scenarios. Makes more sense if you attend the Contentful Learning Center training class.
- migrations
- Contains all the migration scripts used in the commands.
- exports
- Holds exported files from migrations.
- util
- Contains an example utility script that generates an
internal name
field.
- Contains an example utility script that generates an
- mini-website
- A small Next.js example project that uses Contentful.
- Has it's own ReadMe file
contentful space export --space-id "[your-space-id]" --environment-id "[your-space-environment]" --content-file exports/all.json
contentful space export --space-id "[your-space-id]" --environment-id "[your-space-environment]" --content-file exports/only-content-model.json --skip-content --skip-roles --skip-webhooks
contentful space export --space-id "[your-space-id]" --environment-id "[your-space-environment]" --content-file exports/just-content.json --content-only
contentful space import --space-id "[your-other-space-id]" --environment-id "[your-space-environment]" --content-file exports/all.json
contentful space export --space-id "[your-space-id]" --environment-id "[your-space-environment]" --content-file exports/filtered-content.json --query-entries 'sys.contentType.sys.id[in]=landingPage'
contentful space export --space-id "[your-space-id]123" --environment-id "[your-space-environment]" --content-file exports/simulate-error.json --query-entries 'sys.contentType.sys.id[in]=landingPage'
contentful space migration --space-id "[your-space-id]" --environment-id "[your-space-environment]" migrations/1.create-blog-post.js
contentful space migration --space-id "[your-space-id]" --environment-id "[your-space-environment]" migrations/2.migrate-posts.js -y
contentful space migration --space-id "[your-space-id]" --environment-id "[your-space-environment]" migrations/3.split_author_name_field_into_two_fields.js
contentful space migration --space-id "[your-space-id]" --environment-id "[your-space-environment]" migrations/4.create-author-type.js
contentful space migration --space-id "[your-space-id]" --environment-id "[your-space-environment]" migrations/99.cleanup.js
MIT
Reach out if you have any questions Chigoriddim