Created
October 30, 2023 06:05
-
-
Save mikaelvesavuori/9c29316013859e3918e135ed26703d36 to your computer and use it in GitHub Desktop.
Import and export spaces in Contentful.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# See: https://www.contentful.com/developers/docs/tutorials/cli/import-and-export/ | |
EXPORT_FOLDER="export" | |
EXPORT_FILE="backup.json" | |
SPACE_ID="YOUR_ID_HERE" | |
mkdir -p $EXPORT_FOLDER | |
npx contentful-cli login | |
npx contentful-cli space use $SPACE_ID | |
npx contentful-cli space export \ | |
--save-file \ | |
--export-dir $EXPORT_FOLDER \ | |
--content-file $EXPORT_FILE \ | |
--download-assets \ | |
--include-drafts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# See: https://www.contentful.com/developers/docs/tutorials/cli/import-and-export/ | |
EXPORT_FOLDER="export" | |
EXPORT_FILE="backup.json" | |
SPACE_ID="YOUR_ID_HERE" | |
mkdir -p $EXPORT_FOLDER | |
npx contentful-cli login | |
npx contentful-cli space use $SPACE_ID | |
npx contentful-cli space import --content-file $EXPORT_FOLDER/$EXPORT_FILE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
npm install -D contentful-cli |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment