Skip to content

cloudfour/contentstack-import

 
 

Repository files navigation

Contentstack import utility FORK

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...

Usage

  • npm run prep will read the files from source_data/ and write to output_data/
  • npm run test will run the test suite

Requirements

  • 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

Import Sequence Checklist

  1. Update productionMode variable in config.js
  2. Run npm run test to make sure nothing broke
  3. Run npm run prep to build new data files
  4. Double-check that article reference fields point to NON *IMPORT versions
  5. npm run import
  6. 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.

About

Node.js utility to import content into Contentstack

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%