Skip to main content
More in Learn

Shopify Migration Script

Our Shopify to Crystallize migration tool allows you to migrate your existing Catalogue, Customers, and Orders from Shopify to Crystallize seamlessly with a straightforward and clean structure.

Shopify separates products into various Collections, making it more complex as new products are added. Same goes with orders, as order input thresholds can be an issue when a business starts scaling.

Getting Started

The Shopify Migration Script is Open Source and hosted on GitHub. Download or clone the script using git:

git clone https://github.com/CrystallizeAPI/shopify-migration-script.git

With the script downloaded, navigate into the project and install the required dependencies:

cd ./shopify-migration-script && yarn

Configuring Environment Variables

In order to migrate your Shopify data to Crystallize, you will first need to have a Shopify Admin API Access Token. To get one, navigate to the Apps section of your Shopify store’s admin panel. Create a new app with permissions read_products, read_orders, and read_customers (if you are only planning to import products, you only need to select read_products). Finally, go to the “API credentials” tab of the app you created, and take note of the Admin API Access Token.

You will also need to have created a tenant in Crystallize, taking note of the tenant identifier. Next, in the Crystallize, go to the Settings page, Access Tokens, and generate a new pair of access tokens. You will need all of these credentials for the next step.

In the root directory of the Shopify Migration Script project, you will find a file named .env.example. Make a copy of this file named .env and fill in the missing variables for your Shopify store name, Shopify admin API key, Crystallize tenant name, and Crystallize credentials.

Once your .env file is correctly configured, you are ready to run the script.

Running the Script

To begin migrating your products, customers, and orders to Crystallize, run the following command:

yarn migrate

This will fetch all of the products, orders, and customers from your Shopify store. Once fetched, the script will map the data to fit the Crystallize structure.

For the catalogue, folders will be generated based on the product type and matching products will be added to those folders. Topic maps will also be created based on the Shopify collections and tags and added to the products.

To import only one specific part of this tool, you can use individual commands. For importing only the Catalogue:

yarn migrate:catalogue

For only Customers:

yarn migrate:customers

For only Orders:

yarn migrate:orders

Shape It To Your Needs

You can, of course, shape the entire way the catalogue, orders, and customers are mapped between Shopify and Crystallize. The files relevant to this are the following:

src/crystallize/map-customer.ts
src/crystallize/map-order.ts
src/crystallize/map-product.ts
src/crystallize/map-product-variant.ts

Check Out Our Shopify Migration Livestream

People showing thumbs up

Need further assistance?

Ask the Crystallize team or other enthusiasts in our slack community.

Join our slack community