Before proceeding to upgrade, please ensure you’re at Spree 5.1
Upgrade steps
1. Update gems
1. Update gems
2. Install and run missing migrations
2. Install and run missing migrations
3. Migrate to metafields or keep using properties
3. Migrate to metafields or keep using properties
Spree 5.2 introduces Metafields, which are a new way to store additional information about an object. Previously, we used Product Properties to enrich products. Metafields are more powerful, more flexible and can be attached to any object not just products.However we now that properties were available in Spree since it’s beginning. So we decided to keep them for backward compatibility until Spree 6.0 to give you time to migrate to metafields.To keep using properties, you will need to set a configuration flag in your You can still use metafields, along side properties.To migrate to metafields, you will need to run the following command:This will migrate your current data to the new format.Remember that you will need to update your API calls to fetch metafields instead of properties, eg.
config/initializers/spree.rb file:4. Migrate Product Details pages to PDP 2.0 with blocks and metafields
4. Migrate Product Details pages to PDP 2.0 with blocks and metafields
Spree 5.2 greatly enhances the product details page management in page builder with block support and metafields. To ensure your existing product details pages are migrated to the new system, run the following command:This works great with our default storefront theme. If you’re using a custom theme, you will need to adjust your templates.
5. Migrate store policies
5. Migrate store policies
Spree 5.2 introduces more flexible way to manage store policies (eg. terms of service, privacy policy, returns policy, shipping policy).Previously they were just attributes (rich text fields) on the Store model. Now they are stored in the new Policy model.To migrate to the new system, you will need to run the following command:This will migrate your current data to the new format.
If you’re using a custom theme, you will need to adjust app/views/spree/checkout/_footer.html.erb template to be able to manage checkout footer links which was also expanded (now you can link to Pages, Policies, URLs and more).
current_store.policies won’t work anymore, you will need to use current_store.links instead.
