APIDeveloperUserRelease NotesDemoContact Us
  • Core

    • Addresses
    • Adjustments
    • Calculators
    • Inventory
    • Orders
    • Payments
    • Preferences
    • Products
    • Promotions
    • Shipments
    • Taxation
  • Customization

    • Storefront Customization
    • View Customization
    • Asset Customization
    • Images Customization
    • Dependency system
    • Logic Customization
    • Checkout Flow
    • API v2 Customization
    • API v1 Customization
    • Custom Authentication
    • Internationalization
    • Extensions
    • Emails Customization
  • Source

    • About the Code
    • Getting Help
    • Navigating the Source
  • Tutorials

    • Getting Started
    • Add Spree to an existing Ruby on Rails application
    • Developing Spree
    • Improve SEO
    • Creating an Extension
    • Deface Overrides
    • Extend Product Attributes
    • Security
    • Testing Spree Applications
    • Updating Extensions to Rails 6 and Spree 4
  • Upgrades

    • Upgrading Spree 4.1 to 4.2
    • Upgrading Spree 4.0 to 4.1
    • Upgrading Spree 3.7 to 4.0
    • Upgrading Spree from 3.6 to 3.7
    • Upgrading Spree from 3.5 to 3.6
    • Upgrading Spree from 3.4 to 3.5
    • Upgrading Spree from 3.3 to 3.4
    • Upgrading Spree from 3.2 to 3.3
    • Upgrading Spree from 3.1 to 3.2
    • Upgrading Spree from 3.0 to 3.1
    • All Upgrade Guides

Table Of Contents

Update GemfileRun bundle updateInstall missing migrationsRun migrationsDecide what to do nextMigrate to the new Storefront UIStay at the current UIRead the release notesMore info

Upgrading Spree 4.0 to 4.1

This guide covers upgrading a 4.0 Spree application to Spree 4.1.

If you have any questions or suggestions feel free to reach out through Spree slack channels

If you’re on an older version than 4.0 please follow previous upgrade guides and perform those upgrades incrementally, eg.

  1. upgrade 3.3 to 3.4
  2. upgrade 3.4 to 3.5
  3. upgrade 3.5 to 3.6
  4. upgrade 3.6 to 3.7
  5. upgrade 3.7 to 4.0

This is the safest and recommended method.

Update Gemfile

gem 'spree', '~> 4.1'
gem 'spree_gateway', '~> 3.9'

Run bundle update

Install missing migrations

rails spree:install:migrations

Run migrations

rails db:migrate

Decide what to do next

Now you have two options:

  1. Migrate to the new Storefront UI
  2. Stay at the current UI

Migrate to the new Storefront UI

Spree 4.1 comes with a completely new mobile-first ultra-fast Storefront powered by Turbolinks.

To replace your current frontend with the new Spree UI follow these steps:

  1. Update Spree Auth Devise to 4.1 in your Gemfile

    gem 'spree_auth_devise', '~> 4.1'
  2. In your project root directory run:

    rails g spree:frontend:copy_storefront

    WARNING this will overwrite your current project templates, it’s required for the new UI, so if you’ll be asked by the generator what to do please choose A to proceed

  3. Next, you will need to copy over two files:

    • spree_storefront.rb to config/initializers/spree_storefront.rb
    • spree_storefront.yml to config/spree_storefront.yml
  4. If you overwrote any spree_frontend controllers you will need to either remove your local copies or move your custom logic to decorators
  5. Same goes for helpers
  6. You will also need to remove this line:

    //= require spree/frontend/spree_auth

    from vendor/assets/javascripts/spree/frontend.all.js file

Stay at the current UI

If you wish to not move to the new Storefront UI it’s still an option. Just proceed with the steps described below.

  1. Keep Spree Auth Devise at the version you’re currently using

    If you’re using Spree Auth Devise gem you need to lock it at 4.0.0 in your Gemfile:

    gem 'spree_auth_devise', '~> 4.0.0'
  2. Copy over all views from Spree 4.0

    Copy over views from: https://github.com/spree/spree/tree/4-0-stable/frontend/app/views to your application views directory: app/views

    WARNING remember to not overwrite your custom changes!

  3. Copy over all Stylesheets from Spree 4.0

    Copy over stylesheets from: https://github.com/spree/spree/tree/4-0-stable/frontend/app/assets/stylesheets to app/stylesheets

    WARNING remember to not overwrite your custom changes!

  4. Copy over all JavaScript from Spree 4.0

    Copy over stylesheets from: https://github.com/spree/spree/tree/4-0-stable/frontend/app/assets/javascripts to app/javascripts

    WARNING remember to not overwrite your custom changes!

Read the release notes

For information about changes contained within this release, please read the 4.1.0 Release Notes.

More info

If you have any questions or suggestions feel free to reach out through Spree slack channels

Propose changes to this page
Designed and developed bySpree Commerce & Ruby on Rails developers© Spree Commerce. 2021 All Rights Reserved.