Skip to main content

v1.8

Medusa v1.8 comes with many new features while introducing architectural changes contributing toward making Medusa more modular and portable to new, modern environments.

This has led to breaking changes and this document will guide you through the required actions.

Please note that by upgrading to v1.8 of Medusa, you must also upgrade your admin to become a plugin as explained in the admin upgrade guide. If you've made customizations to your admin, please refer to this section of the admin upgrade guide before considering updating to v1.8 of Medusa.

Required Actions

It's recommended to use yarn when updating the following dependency to avoid any unexpected errors.

Step 1: Update Typeorm

To get started using Medusa v1.8, you first need to upgrade your version of Typeorm:

yarn add typeorm@0.3.11
Report Incorrect CodeCopy to Clipboard

The dependency on Typeorm has been upgraded from 0.2.31 to 0.3.11, which comes with significant breaking changes. Follow Typeorm's upgrade guide to refactor your custom code.

Step 2: Update Core Package

Install version 1.8 of the core:

yarn add @medusajs/medusa@1.8.0
Report Incorrect CodeCopy to Clipboard

Step 3: Install Required Modules

The core engine doesn't come with a Redis caching mechanism and Redis events system any longer. Instead the core relies on the Module API for those two sub-systems.

As a result, you are required to install and use those modules to ensure your application works as expected.

Install the new Redis cache module with the following command:

yarn add @medusajs/cache-redis@1.8.0
Report Incorrect CodeCopy to Clipboard

Install the new Redis event bus module with the following command:

yarn add @medusajs/event-bus-redis@1.8.0
Report Incorrect CodeCopy to Clipboard

Then, add both modules to the exported configuration in medusa-config.jsCopy to Clipboard.

medusa-config.js
module.exports = {
// ...
modules: {
eventBus: {
resolve: "@medusajs/event-bus-redis",
options: {
redisUrl: "your-redis-url",
},
},
cacheService: {
resolve: "@medusajs/cache-redis",
options: {
redisUrl: "your-redis-url",
},
},
},
}
Report Incorrect CodeCopy to Clipboard

Make sure to replace your-redis-urlCopy to Clipboard with the connection URL to your Redis installation.

Step 4: Run Migrations

Finally, you should run migrations to ensure your database is up to date with our schema changes:

npx @medusajs/medusa-cli migrations run
Report Incorrect CodeCopy to Clipboard
Was this page helpful?