Update Shopware 6 with composer update --no-scripts

Learn how to update Shopware 6 with a alternative composer command. This guide provides step-by-step instructions for a hopefully seamless update process.

Since I encountered several issues during the Shopware 6 update process, and a Shopware developer recommended using composer update --no-scripts instead of composer update, I decided to write a guide on how to update Shopware 6 using this command.

Please note that this guide is applicable if Shopware was installed using the shopware-installer.phar.php and you have SSH access to the server. While it may also work for other installation methods, I have not tested those.

This guide allows you to specify the exact version of Shopware 6 you want to update to.

You can find all Shopware releases on GitHub.

Steps to Update Shopware 6 with Composer

  1. Backup Your System:

    • Ensure you have a backup of your database and files before proceeding.
  2. Prepare for Update:

    • Run the following command to prepare the system for the update:
      bin/console system:update:prepare
  3. Check the Target Version’s composer.json:

  4. Update Your composer.json:

    • Open your Shopware composer.json file.
    • Update the version of shopware/core to match the target version.
    • Adjust other packages listed in the require section to align with the new version’s dependencies.
  5. Update Plugin Dependencies:

    • If you have installed any plugins via Composer, ensure their versions are updated to be compatible with the target Shopware version.
  6. Execute Composer Update:

    • Run the following command to update dependencies:
      composer update --no-scripts
    • Composer will notify you of any conflicts. If conflicts occur, manually resolve them by editing the composer.json file and re-running the previous command. For example, when upgrading from Shopware 6.5 to 6.6, change the required package symfony/runtime to >=5. Or update PHP as required.
  7. Remove Bin Directory:

    • Remove the bin directory and index.php to ensure recipes:install can update files like bin/console:
      rm -rf bin
      rm public/index.php
  8. Install Composer Recipes:

    • Execute the following command to install Composer recipes:
      yes | composer recipes:install --force --reset
  9. Finish the Update:

    • Run the following commands to complete the update process:
      bin/console cache:clear
      bin/console system:update:finish

Update Plugins

  1. Update All Plugins:

    • Run the following command to update all plugins:
      bin/console plugin:update:all
  2. Clear Cache:

    • Clear the cache by running:
      bin/console cache:clear
  3. Update All Apps:

    • If you have installed plugins with the new app system, update them with:
      bin/console app:refresh
  4. Rebuild the Storefront:

    • Rebuild the storefront to ensure all changes are applied:
      bin/console assets:install
      bin/console bundle:dump
      bin/console theme:compile
      bin/console cache:clear

If you encounter any issues, check the logs and resolve them accordingly.

I can also recommend joining the Shopware Discord Community and asking for help there.

Known errors

If this article helped you, you can sponsor my work on GitHub.