Shopify Migration Script
Set up the Configuration
The migration script requires a number of environment variables to set up before running, like your Shopify Private Storefront App and Crystallize keys. These can be passed as arguments when running the script or be setup in the lib/config.js file.
Read more on creating a Shopify Private app in the docs.
Two import modes
The script can be used to either migrate your Catalogue through Shopify’s Storefront API or your orders through a CSV file (exported from Shopify). It also includes a Single Product import logic, if you would like to test with a single product. You can find that under /catalogue/singleProductImport
To import your catalogue run:
yarn run import
To import your orders from a .csv file run:
FILE=*your-csv-file-relative-path* yarn import-orders
Shape it to your needs
From SKUs to content, every case can vary in structure and logic and you can tweak the script to fit these needs.
The core logic of the script is focused around:
Clean information Architecture
The migration script follows Crystallize’s modern topic-based approach. Multiple categories can be associated to products by creating them as topics. Starting from top to bottom, the script will create a tree topic-structure and tag products with topics based on naming.
These can be specified as arguments in index.js file. The script behaviour can be altered in these files:
- lib/crystallize/index.js (createTopics)
* Notice that by default the topics generated by the categories passed as arguments will not be included in the catalogue structure.