This guide covers a code-based approach for migrating data to Swell, and how to handle some of the quirks and features specific to Shopify. It's intended to accompany our Migrate to Swell guide.

We'll be using the Shopify Admin API to access your store. To obtain credentials, create a new private app from your Shopify dashboard. App creation can be found in Shopify under the Apps > Manage private apps. See Shopify's Authentication documentation for more information.

You'll need to enable read access for each data type you wish to import. We'll cover Products, Customers, and Orders here; however, you can migrate others on your own. Save once you've set the scopes and copy the Admin API Password.

Clone our Shopify migration repo and create a .env file with the following values based on the example provided in the repo:

  1. Once the .env file has been created, install the packages with npm install.
  2. Run the scripts with npm run customers. Replace customers with products and then orders to run the different scripts.

In order for the scripts to map associated data correctly, run the scripts in order of customers, products, and then orders.

The customer migration script only pulls in the default_address associated with the Shopify customer account, so the script will not bring over any additional addresses tied to a customer's account. Additional addresses can be added to an account after it has been migrated.

Payment information will need to be migrated over separately and linked to the newly created account id. For additional information on payment migration, see our Migrate to Swell guide.

For additional details, see Shopify's API reference for customers.

Due to the limitations of Shopify's API, you cannot migrate over customer passwords. This means that customers will be prompted to reset their passwords when they attempt to log in to their accounts post-migration.

Swell groups similar products together using categories, which are comparable to Shopify's collections. The difference is categories can be nested, but not assigned automatically. Since categories do not align directly with collections, the script does not transfer them over. You can bulk assign categories to products in the Swell dashboard post-migration. Navigate to the Products tab within the Swell dashboard to manage and create categories or assign products to categories.

For additional details, see Shopify's API reference for products.

There are a few limitations with the migration script for products:

  • Product images cannot be synced through this script as the pictures hosted on Shopify will disappear once the Shopify store has been closed.
  • Shopify product ids will change to a Swell product id; the shopify_id will be retained as a custom field.
  • The product status will be set to active: false by default.

We recommend using our Import feature for uploading product images, where you can batch import product images either through .CSV or .JSON files by referencing the Swell product id.

The order script migrates all historical order data listed on Shopify while retaining the Shopify product ids and customer information within the object data. A new Swell order id will be assigned to each order, and the original order dates will be preserved on the Swell record.

For additional details, see Shopify's API reference for orders.

That's it—congrats on getting your store migrated to Swell! If there are still additional data sets you are wanting to migrate, see our general migration guide for more information on migration for data not covered within this guide. Otherwise, you're all set. Thank you for choosing Swell.