This is a fork of contentstack/contentstack-import which we've hacked to include a pre-processing script which converts an exported database dump into the structure/format compatible with Contentstack's import tool.
For import functionality, see the original README...
npm run prep
will read the files from source_data/ and write to output_data/npm run test
will run the test suite
- Replace non-whitelisted authors with "Juice Staff"
- Map author usernames to auther entry (imports)
- Filter out articles NOT ( isActive && isPublished )
- Parse the string of category strings into individual items
- Map categories to category entries
- Gather image fields to match the Cloudinary fields
- Coerce SequenceId into int field
- Map image caption to
legacy_image_caption
- Compile the URL field from various fields
- Update
productionMode
variable in config.js - Run
npm run test
to make sure nothing broke - Run
npm run prep
to build new data files - Double-check that article reference fields point to NON *IMPORT versions
npm run import
- Consider updating the references in CS to REMOVE *_import_testing options
NOTE: Lots of vague errors in the console are normal. Usual suspects:
error: Success file was not found at: /Users/emerson/Code/contentstack-import/_backup_841/mapper/entries/en-us/juice_article/success.json
error: Entry Uid: blt52843cdac9ead162 of Content Type: juice_article_import_testing failed to update in locale: en-us
error: {"error_message":"Entry update failed.","error_code":121,"errors":{"title":["is not unique."]}}
^ Neither of these appear to indicate that a problem actually happened.