You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+55-10Lines changed: 55 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,11 +14,11 @@ This is a library that helps you backup your Content Model, Content and Assets o
14
14
To import your exported data, please refer to the [contentful-import](https://github.com/contentful/contentful-import) repository.
15
15
16
16
## :exclamation: Usage as CLI
17
+
17
18
> 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.
18
19
>
19
20
> 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.
// contentfulExport returns a Promise so you can use async/await, etc.
68
+
awaitcontentfulExport(options)
69
+
```
70
+
54
71
### Querying
55
72
56
73
To 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).
@@ -108,15 +125,19 @@ contentfulExport(options)
108
125
### Basics
109
126
110
127
#### `spaceId`[string][required]
128
+
111
129
ID of the space with source data
112
130
113
131
#### `environmentId`[string][default: 'master']
132
+
114
133
ID of the environment in the source space
115
134
116
135
#### `managementToken`[string][required]
136
+
117
137
Contentful management API token for the space to be exported
118
138
119
139
#### `deliveryToken`[string]
140
+
120
141
Contentful Content Delivery API (CDA) token for the space to be exported.
121
142
122
143
Providing `deliveryToken` will export both entries and assets from the
@@ -145,17 +166,21 @@ Note: Tags are only available on the Contentful Management API, so they will not
145
166
### Output
146
167
147
168
#### `exportDir`[string][default: current process working directory]
169
+
148
170
Defines the path for storing the export JSON file
149
171
150
172
#### `saveFile`[boolean][default: true]
173
+
151
174
Save the export as a JSON file
152
175
153
176
#### `contentFile`[string]
177
+
154
178
The filename for the exported data
155
179
156
180
### Filtering
157
181
158
182
#### `includeDrafts`[boolean][default: false]
183
+
159
184
Include drafts in the exported entries.
160
185
161
186
The `deliveryToken` option is ignored
@@ -164,67 +189,87 @@ If you want to include drafts, there's no point of getting them through the
Display progress in new lines instead of displaying a busy spinner and the status in the same line. Useful for CI.
229
274
230
275
## :rescue_worker_helmet: Troubleshooting
@@ -259,15 +304,15 @@ contentfulExport({
259
304
If 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.
0 commit comments