Skip to main content

How to upgrade extension

Follow these steps to update the extension via сomposer:

  1. Back up your store's database and web directory.

  2. Log in to the SSH console of your server and navigate to the root directory of the Magento 2 store.

  3. Run the command below to update the current extension with all dependencies:

    composer require mirasvit/module-related:* --update-with-dependencies

    In some cases, the command above may not be applicable, or you may be unable to update only the current module. If that's the case, you will need to upgrade all Mirasvit modules in a bundle. The command above will have no effect in such scenarios. Instead, run the following command to update all Mirasvit modules installed in your store:

    composer update mirasvit/*

    If mirasvit/module-related-hyva or mirasvit/module-related-graph-ql is installed, you don't have to remove it first. From version 1.6.0 Hyvä and GraphQl support ship inside the extension itself, and composer takes the old packages off during this update. No settings are lost, and setup:upgrade removes the retired Hyva_MirasvitRelated module name from app/etc/config.php for you.

    warning

    If the Hyvä companion was installed by unpacking an archive into app/code/Hyva/MirasvitRelated, delete that folder before running setup:upgrade. Composer cannot remove it, and left in place it keeps serving the old templates and records every impression and click twice.

    On a Hyvä storefront version 1.6.0 needs hyva-themes/magento2-theme-module 1.3.14 or newer; composer refuses the update on an older one.

  4. Install the updates by running the following command:

    php -f bin/magento setup:upgrade
  5. Run the command below to set up dependencies:

    php -f bin/magento setup:di:compile
  6. Clean the cache by running the following command:

    php -f bin/magento cache:clean
  7. On a Hyvä storefront, rebuild the theme assets. The product blocks render through the theme's own slider and grid, and the theme picks up the extension's templates only when Tailwind runs again:

    bin/magento hyva:config:generate
    cd /path/to/theme/web/tailwind/
    npm run build
    cd /path/to/project/
  8. Deploy static view files:

    rm -rf pub/static/*; rm -rf var/view_preprocessed/*;
    php -f bin/magento setup:static-content:deploy