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.
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:
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:
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:
Install the new Redis event bus module with the following command:
Then, add both modules to the exported configuration in
Make sure to replace
your-redis-url 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: