Before proceeding to upgrade, please ensure you’re at Spree 5.3
Upgrade steps
Remove spree_sample gem from your Gemfile
Samples are now included in the spree gem. If you’ve added previously spree_sample to your Gemfile, remove it by running:
Update gems
Fetch and run missing migrations
Fix your Admin user class
Your admin user model needs to include theSpree::AdminUserMethods concern instead of Spree::UserMethods.
Previously UserMethods bundled AdminUserMethods but that caused all kinds of issues.
So if you have a model like this:
app/models/spree/admin_user.rb.
Backfill Image Thumbnail IDs
Spree 5.4 adds aprimary_media association to both Product and Variant models. This greatly speeds up rendering Product lists everywhere (API, Admin Dashboard and spree_storefront), as previously we’ve had to load all media/images for each product and determine which one is the one to render a thumbnail.
To generate the new association you will need to run a rake task (both in development and production environments):
Prefixed IDs
Spree 5.4 by default uses prefixed IDs for resources (eg.prod_6VsgxZbenF) instead of just IDs from the database. These IDs are now used in Admin Dashboard, API v3, Events system and Webhooks.
Event Subscribers
If you previously added Subscribers for Events, eg.order.completed with code such as:
find_by_prefix_id without the bang (!) to gracefully handle cases where the record might not exist.
Adding Prefixed IDs support to your custom models
All models inheriting fromSpree::Base (or Spree.base_class) can support Prefixed IDs by adding the following code to your model:
Migrate Checkout Zones to Markets
Spree 5.4 introduces Markets as the primary way to manage which countries are available for checkout, along with their currencies and locales. The legacycheckout_zone field on the Store model is now deprecated and will be removed in Spree 6.0.
New stores automatically get a default market created from their default_country — no manual setup needed. For existing stores that used checkout_zone, run the migration rake task:
- Read the
checkout_zonecountries from each store - Create a default Market with those countries, currency, and locale
- Clear the
checkout_zone_idcolumn
Deprecated Store methods
The following Store methods now emit deprecation warnings and will be removed in Spree 5.5:
The
store.default_country reader now returns the first country (by name) from the store’s default market. The store.default_country_iso= setter still works and is used to set the country when creating a store — a default market is automatically created from it.
Code that references checkout_zone for tax
If your application used store.checkout_zone as a tax zone fallback, update it to use Spree::Zone.default_tax instead:
ActiveMerchant removed from Spree Core
Spree 5.4 no longer depends on theactivemerchant gem. All internal usages have been replaced with lightweight Spree-native classes:
| ActiveMerchant class | Spree replacement |
|---|---|
ActiveMerchant::Billing::Response | Spree::PaymentResponse |
ActiveMerchant::ConnectionError | Spree::PaymentConnectionError |
Spree::PaymentResponse is a drop-in replacement with the same constructor signature:
success?, message, params, authorization, avs_result, cvv_result, test?, and YAML serialization (for log entries).
Updating custom payment methods
If you have a custom payment method (gateway) that returnsActiveMerchant::Billing::Response, update it to return Spree::PaymentResponse instead:
ActiveMerchant::ConnectionError, update it to rescue Spree::PaymentConnectionError:
Using spree_gateway or other ActiveMerchant-based extensions
If you use the spree_gateway gem or another extension that depends on ActiveMerchant, add activemerchant directly to your application’s Gemfile:
LogEntry#parsed_details still deserializes ActiveMerchant::Billing::Response objects when the gem is present.
Address hash method renamed
Spree::Address#active_merchant_hash has been renamed to #gateway_hash. A backwards-compatible alias is provided, so existing code continues to work without changes.
(Optional) Install Legacy API v2 extension
Spree 5.4 ships with API v3, which marks deprecation of API v2. API v2 is still available but you need to install it separately. If you currently use API v2, you can do this by running the following command:rails_helper.rb:
jsonapi-rspec gem to your Gemfile:
bundle install
(Optional) Install Spree Multi Store
Multi-store features like multiple store management & custom domains were moved to a separate gemspree_multi_store.
If you rely on these features please run:
Spree Multi-Store is licensed under the AGPL v3 License.If you would like to use it in a commercial application, please contact us to obtain a commercial license.
(Optional) Install Legacy Product Properties extension
Product Properties have been extracted from Spree core to a separate gemspree_legacy_product_properties. Product Properties were already deprecated in favor of Metafields and disabled by default since Spree 5.1.
If you have product_properties_enabled: true in your Spree configuration or rely on Product Properties in any way, install the extension:
(Optional) Install Spree Posts extension
Posts and Post Categories management were extracted from Spree core into a separate gemspree_posts.
If you use these features before run this command to restore them:

