# Migrate from Shopify

Source: https://developers.swell.is/guides/migrate-from-shopify

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](https://developers.swell.is/guides/migrate-to-swell).

### Authentication

We'll be using the Shopify Admin API to access your store. To obtain credentials, create a custom app from your Shopify admin under Settings > Apps and sales channels > Develop 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 configured the Admin API scopes, then install the app and copy the Admin API access token. Note that Shopify only reveals the token once.

## Setup instructions

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

**.env example**

```json
SHOPIFY_HOST=your-shopify-store-id.myshopify.com # Your Shopify store domain
SHOPIFY_API_VERSION=2025-07 # A currently supported Shopify API version
SHOPIFY_PASSWORD=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 # The Admin API access token from your custom app in Shopify
SWELL_STORE_ID=your-swell-store-id # The ID of your Swell store from {id}.swell.store
SWELL_API_KEY=1234abcd1234abcd1234abcd1234abcd # The secret key from your API settings page in Swell
```

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

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

### Customers

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](https://developers.swell.is/guides/migrate-to-swell).

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

> **Warning:** 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.

### Products

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.

> **Tip:** 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`.

### Orders

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.

### Next steps

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](https://developers.swell.is/guides/migrate-to-swell) for more information on migration for data not covered within this guide. Otherwise, you're all set. Thank you for choosing Swell.
