This allows you to export structured JSON data from Contentful. You can then use contentful-importer to import the data into another space.
gem install contentful-exporter
This will install the contentful-exporter
executable.
Before you can export your content from Contentful, you need to create a
settings.yml
file and fill in your credentials:
#Contentful
access_token: access_token
space_id: organization_id
A Contentful OAuth access token can be created using the Contentful Management API - documentation
Once you installed the Gem and created the YAML file with the settings you can invoke the tool using:
contentful-exporter --config-file settings.yml --action
-
Create YAML file with required parameters (eg.
settings.yml
):#PATH to all data data_dir: DEFINE_BEFORE_EXPORTING_DATA #Contentful credentials access_token: ACCESS_TOKEN space_id: SPACE_ID
-
Now your content can be exported. It can be chosen to use one (default) or two parallel threads to speedup this process.
Entries
contentful-exporter --config-file settings.yml --export-entries
or
contentful-exporter --config-file settings.yml --export --threads 2
Assets
contentful-exporter --config-file settings.yml --export-assets
or
Content-types
contentful-exporter --config-file settings.yml --export-content-types
or
All
contentful-exporter --config-file settings.yml --export
To display all actions use the -h
option:
contentful-exporter -h
Before exporting any content you can verify that your credentials in the settings.yml file are correct:
contentful-exporter --config-file settings.yml --test-credentials