# Migration Context: Medusa v1 -> v2 # Generated by Changelogs.us: 2026-11-30T03:04:39.979653+00:00 # Target Version: v2.23.1 # Upgrade Command: N/A # Breaking Changes: 68 # Security Fixes: 1 ## Executive Summary Upgrading Medusa from 1 to 2 involves 67 releases with risk rating High. ## Breaking Changes List: - [vv2.4.0] While this upgrade introduced breaking changes, none of them will impact user projects directly. The only required action is upgrading the MikroORM dependencies in your project.: - [vv2.5.0] Breaking changes The payment provider interface, originally designed for Medusa V1, has now been redesigned for V2-a long overdue update. These changes deliver a more unified and intuitive API.: - [vv2.5.0] The following are breaking changes: **Payment Provider interface**: - [vv2.5.0] Fortunately, the revamp did not only introduce breaking changes. This release also introduces support for Account Holders in payment providers. In Stripe, for example, we will create a customer for every signed up user on your platform so you can track payments more easily within Stripe. These methods are optional for payment providers.: - [vv2.6.0] Breaking changes: this change is not backward compatible due to security considerations: - [vv2.7.0] Breaking changes This release adds support for a customer to have multiple account holders, therefore supporting multiple payment providers at the same time.: - [vv2.8.0] Breaking changes This release introduces important changes to the `completeCartWorkflow` aimed at improving robustness and making it easier to recover from failures.: - [vv2.8.0] Breaking changes This release changes the source of line item titles and subtitles. The title has changed from the variant title to the product title, and the subtitle has changed from the product title to the variant title.: - [vv2.9.0] Breaking change This release updates the promotion application logic to throw when applying an invalid promotion code. This change improves the experience for developers building storefronts by allowing them to handle invalid discount codes directly from the API response, rather than checking cart promotions after the API request.: - [vv2.10.0] This release contains breaking changes, so please read the release notes carefully. The breaking changes are all the result of fixing behavior that has not worked as intended until now.: - [vv2.10.0] Breaking change The `idempotent` configuration on workflows no longer retains executions in the database after completion, unless a retention time is specified. Up until now, if the `idempotent` flag was set, workflow executions were retained indefinitely, which was never the intention. The intention was to make a workflow idempotent for the duration of its execution, and only longer if the retention time was explicitly configured.: - [vv2.10.0] Breaking change The return types of `update` and `create` in `MedusaService` have been corrected to properly handle the different shapes of inputs.: - [vv2.10.0] Breaking change Previously, if the `emitEventStep` queued an event and the workflow later failed, the compensating flow would emit that queued event instead of removing it. This caused unexpected behavior during rollback.: - [vv2.10.0] Breaking change The admin dashboard now supports managing shipping option types, making it easier to categorize options such as Standard and Express.: - [vv2.10.0] This migration will only affect Shipping Options that reference the `type-code` type. If you have been using your own types, they will remain as is. On the contrary, if you have been relying on `type-code`, this is a breaking change.: - [vv2.11.0] This is a breaking change, and the following steps are required to use versions 2.11.0 and over:: - [vv2.12.0] We intentionally kept the existing display_id column unchanged. Migrating it from an auto-incrementing integer to text would be a significant breaking change.: - [vv2.12.0] Breaking change The relationship between Shipping Options and Shipping Option Types has changed from one-to-one to many-to-one. This change should be deemed more a fix, than an actual change of the feature, as this was always the intention. However, it is a breaking change, since the property name has changed.: - [vv2.12.0] The relationship between Shipping Options and Shipping Option Types has changed from one-to-one to many-to-one. This change should be deemed more a fix, than an actual change of the feature, as this was always the intention. However, it is a breaking change, since the property name has changed.: - [vv2.13.0] :construction: Breaking change This release adds `zod` as a dependency of `@medusajs/framework`.: - [vv2.13.0] This change has been marked as breaking although for the vast majority of projects, existing `zod` imports will continue to work through either as a direct dependency (if zod is installed directly in your project), or a transitive dependency.: - [vv2.14.0] This release open sources the Loyalty plugin and includes breaking changes related to Zod, account creation, and more. Please read carefully before updating.: - [vv2.14.0] 🚧 Breaking change Medusa has been upgraded its Zod dependency from v3 to v4. This includes updates to all internal validation schemas and type definitions. For most users, this upgrade is seamless, but if you're using custom validation schemas or directly interacting with Zod types in your project, you may need to:: - [vv2.14.0] I've updated my project to v2.14.0 of Medusa, which upgrades Zod to v4. This is a breaking change. Migrate all Zod v3 usage in my project to Zod v4.: - [vv2.14.0] Breaking changes to fix ### Error customization: - [vv2.14.0] 🚧 Breaking change The Medusa Icons package has been upgraded to support React v19. If you've installed the icons package directly and haven't upgraded to React v19 yet, you may need to update your React version or pin to an earlier version of the icons package. Otherwise, no action is needed.: - [vv2.14.0] 🚧 Breaking change The `create-medusa-app` command and `medusa new` CLI now create projects using a monorepo structure based on the [dtc-starter](https://github.com/medusajs/dtc-starter) template. This provides better separation of concerns between the backend and storefront applications, and allows you to deploy your project to Medusa Cloud seamlessly.: - [vv2.14.0] 🚧 Breaking change We've updated our HTTP types exported from `@medusajs/framework/types` to match exactly the Zod schemas used to validate API routes in the Medusa core. This change doesn't impact most users, and it doesn't impact the API routes interfaces. However, if you've explicitly used or relied any of the following types, make sure to apply the required changes.: - [vv2.14.0] HTTP types breaking changes: - [vv2.15.0] 🚧 Breaking change This version aligns the `width`, `length`, `height`, and `weight` properties on the `Product` and `ProductVariant` data models to be of type `float`. In previous versions, their type was `text` on the `Product` data model, and `number` on the `ProductVariant` data model.: - [vv2.16.0] v2.16.0 is a minor release with several breaking changes that require code or config updates. This prompt covers only the required upgrade steps and breaking changes - additive features in this release (tax line context hook, multi-shipping-method carts, new/custom admin injection zones) are intentionally out of scope; do not implement them.: - [vv2.16.0] The breaking changes in scope: 1. **Package version bump to v2.16.0** for all `@medusajs/*` packages.: - [vv2.16.0] - Cover only the required/breaking changes listed above. Do not implement additive features (tax line context hook, multi-shipping carts, injection zones) even if you notice opportunities - mention them only if the user asks.: - [vv2.16.0] - The plan covers every in-scope breaking change that applies to the project, and explicitly marks the rest N/A with a reason.: - [vv2.16.0] 🚧 Breaking change If you setup the ESLint plugin and config in your Medusa backend, linting will run by default in the `medusa build` and `medusa develop` commands. If there are lint errors, both commands will fail.: - [vv2.16.0] 🚧 Breaking change MikroORM 6.6.12 is affected by [CVE-2026-44680](https://advisories.gitlab.com/npm/@mikro-orm/knex/CVE-2026-44680/). This doesn't impact Medusa applications by default, but can affect Medusa customizations if they're JSON inputs are not properly validated with Zod.: - [vv2.16.0] This version updates MikroORM to 6.6.14. This comes with a breaking change in how MikroORM's `manager.find` method works. Previously, it ignored all relations that don't exist on an entity. Now, it will fail with an error.: - [vv2.16.0] 🚧 Breaking change react-router-dom has also been updated to `6.30.4` due to a recent advisory. The previous version didn't impact Medusa applications; the update is a defensive measure only.: - [vv2.17.0] 🚧 Breaking change Product options in Medusa can now be global - defined once at the store level and reusable across any number of products. Previously, options such as "Size" or "Color" had to be recreated independently for each product. With this release, you define an option once, attach it to as many products as you need, and manage values from a single place. This unlocks consistent variant modeling across large catalogs and reduces duplication when building storefront filters or admin tooling.: - [vv2.17.0] 🚧 Breaking change Auth verification (email, phone, etc.) has been reworked into a flexible, provider-based system. You can now declare exactly which verifications are required per actor type and auth provider via the new `authVerificationsPerActor` config - for example, require email verification for customers using `emailpass`, but skip it for those signing in with Google. Codes are issued and confirmed through pluggable code providers, with a built-in token provider out of the box.: - [vv2.17.0] This is a breaking change: - The verification endpoints moved from `POST /auth/:actor_type/:auth_provider/verification/request` (and `/confirm`) to flat `POST /auth/verification/request` and `POST /auth/verification/confirm`. The request route is now authenticated and takes `entity_id`, `entity_type`, and `code_provider` in the body instead of actor/provider in the URL.: - [vv2.17.0] fix(dashboard): prevent URL param collision breaking pagination in price list add products modal by [@Tusharkhadde](https://github.com/Tusharkhadde) in [#15704](https://github.com/medusajs/medusa/pull/15704): - [vv2.17.2] 🚧 Breaking change Since the components in a `LayoutComposer` controlled page are now arranged through the Editor view (including widgets), the `.after | .before` widget injection zones don't have an effect on where the Widget is placed within its injection zone - you should configure this, just like with any other layout component, through the Editor view. The `.side` is still relevant for Two Column page layouts.: - [vv2.18.0] 🚧 Breaking change The default database load strategy has changed from `SELECT_IN` to `BALANCED`, matching MikroORM v7's intended default. MikroORM picks between a joined and a select-in approach per relation, which improves query performance in most cases. Because it changes how relations are loaded, review query-heavy paths and any snapshot or query-count assertions in your tests after upgrading.: - [vv2.18.0] 🚧 Breaking change > This affects usages of [generated internal services](https://docs.medusajs.com/learn/fundamentals/modules/service-factory#generated-internal-services). They do not impact methods generated by `MedusaService` such as `deletePosts`.: - [vv2.19.0] 🚧 Breaking change This release updates the Medusa Admin dashboard to use Vite v7.3.6 and React Router v7.18.2. This is a breaking change and requires you to make the following changes:: - [vv2.19.0] This release updates the Medusa Admin dashboard to use Vite v7.3.6 and React Router v7.18.2. This is a breaking change and requires you to make the following changes:: - [vv2.19.0] Due to this update, there are the following breaking changes related to Vite and React Router that may impact you if you use these features:: - [vv2.19.0] 🚧 Breaking change The following methods have been removed from the JS SDK as they targeted endpoints that no longer exist:: - [vv2.20.0] 🚧 Breaking change > This only affects Store API requests that expand deeply nested relations through `fields`. Admin routes are unaffected.: - [vv2.20.0] Breaking Changes - **Relations limit on store routes** - Store API routes now enforce a default relations limit to cap query depth and improve performance. Requests that relied on unbounded relation expansion may see fewer nested associations returned. Run `db:migrate` after upgrading. ([#16688](https://github.com/medusajs/medusa/pull/16688)): - [vv2.21.0] 🚧 Breaking change Every Store API route now declares an `allowed` list, and that list is enforced strictly: a requested field or relation is returned only if its exact path appears in the list. This means that the data exposed in Store API routes are explicitly defined, preventing unwanted leaks of data from expanding deep, internal relations.: - [vv2.21.0] You are a Medusa upgrade engineer working inside a user's Medusa project. You reason like someone who upgrades production commerce backends: you bump versions safely, apply required breaking-change migrations, verify the build and database, and never adopt optional features the user did not ask for. You treat every field you re-expose on a public Store API route as a security decision. You make no change the user has not approved.: - [vv2.21.0] Investigate this project and produce a migration plan to upgrade it from its current Medusa version to v2.21.0. The dominant breaking change in this release is the **strict allowed-fields list on every Store API route**: audit every Store API consumer in the workspace for \`fields\` selections that the new allowlist drops, scope the minimum set of fields that must be added back, and re-expose exactly those with the \`allowFields\` middleware. Present the plan for the user's approval before making any edits.: - [vv2.21.0] v2.21.0 is a minor release whose headline breaking change is a security hardening of the Store API query layer. This prompt covers the required upgrade steps and that breaking change in depth - do not adopt optional/additive features in this release.: - [vv2.21.0] Read the v2.21.0 GitHub release notes and the notes for every release between the project's current version and 2.21.0. Fold any additional breaking change, required migration, or config change into the plan and call it out explicitly. If the project is coming from below 2.20.0, the Store relations-depth limit (\`storeRelationsLimit\`, default 3) and the payment-provider/region validation introduced in 2.20.0 also apply - handle them as part of this upgrade.: - [vv2.21.0] 2. **Confirm the breaking-change list from the release notes.** Read the v2.21.0 release notes and those of every release between the project's current version and 2.21.0. Incorporate anything this prompt does not cover, and call it out explicitly.: - [vv2.21.0] - Edit only what a v2.21.0 upgrade requires. Do not refactor unrelated code, reformat files, or adopt optional v2.21 features. Every change must trace to a v2.21.0 breaking change or the version bump; list anything else under manual follow-ups instead.: - [vv2.21.0] 2. **Migration plan (approval required)** - the intended version bumps, the static inventory of Store API \`fields\` and \`order\` selections (file:line, route, selection, unresolved yes/no), any other breaking change from the release notes, and the migrations to run. State that the dropped-field diff follows the install. End with an explicit request for approval; do not proceed past this section until approved.: - [vv2.22.0] 🚧 Breaking change > This change only affects projects running Node.js 20. Projects already on Node.js 22 are unaffected.: - [vv2.23.0] You are a Medusa upgrade engineer working inside a user's Medusa project. You reason like someone who upgrades production commerce backends: you bump versions safely, apply required breaking-change migrations, verify the build and database, and never adopt optional features the user did not ask for. You treat every major-version dependency bump as a set that must move together, because a half-applied set installs two copies of a library and breaks things far from the cause. You make no change the user has not approved.: - [vv2.23.0] Investigate this project and produce a migration plan to upgrade it from its current Medusa version to v2.23.0. The dominant breaking change in this release is the **coordinated major-dependency upgrade**: Medusa now runs on Express 5 and its admin on React 19, Vite 8, Tailwind CSS 4, and TanStack Table v9, so the project's own copies of those dependencies must move in the same install, and every custom API route matcher, admin customization, Redis option, and instrumentation file built against the old majors must be audited. Present the plan for the user's approval before making any edits.: - [vv2.23.0] v2.23.0 is a minor release whose breaking changes are concentrated in major-version updates of the dependencies Medusa installs alongside its own packages - on the server (Express 5, node-redis sessions, BullMQ 6 / ioredis 6, OpenTelemetry SDK 3) and in the admin (React 19, Vite 8, Tailwind CSS 4, TanStack Table v9, i18next / TanStack Query). This prompt covers only the required upgrade steps and breaking changes - do not adopt optional/additive features in this release.: - [vv2.23.0] Read the v2.23.0 GitHub release notes and the notes for every release between the project's current version and 2.23.0. Fold any additional breaking change, required migration, or config change into the plan and call it out explicitly. If the project is coming from below 2.21.0, the strict Store API `allowed` field list (with the global `allowFields` middleware as the only way to re-expose a field) applies; from below 2.20.0, the Store relations-depth limit (`storeRelationsLimit`) and the payment-provider/region validation also apply - handle them as part of this upgrade.: - [vv2.23.0] 2. **Confirm the breaking-change list from the release notes.** Read the v2.23.0 release notes and those of every release between the project's current version and 2.23.0. Incorporate anything this prompt does not cover, and call it out explicitly.: - [vv2.23.0] - Edit only what a v2.23.0 upgrade requires. Do not refactor unrelated code, reformat files, or adopt optional v2.23 features (audit-log namespaces, impersonator, and metadata filtering; the `metadata` function in a route's audit setting; default registration of the Audit and RBAC modules on Medusa Cloud). Every change must trace to a v2.23.0 breaking change or the version bump; list anything else under manual follow-ups instead.: - [vv2.23.0] 3. **Changes applied** - bulleted, grouped as: Version bumps / Express route matchers and handlers / Admin customizations / Redis configuration / Instrumentation / Loyalty Plugin storefront fields / Other breaking changes. Each item: file path + a one-line description. State "none required" for any empty group.: - [vv2.23.0] 5. **Manual follow-ups** - anything the user must review or decide: RBAC role review, removed Redis options with no equivalent, deploy coordination for Redis modules, storefront upgrades outside this workspace, deprecated `debounce` options, and other breaking changes surfaced from the release notes. "None" if empty.: ## Patched Vulnerabilities (CVEs): - [CVE-2026-44680] (Severity: UNRATED) in vv2.16.0: Security advisory CVE-2026-44680 patched in medusajs v2.16.0 ## Instructions for AI Assistant: When migrating user code from Medusa 1 to 2, scan for the deprecated APIs and breaking changes above and refactor code to use modern vv2.23.1 idioms.