p16r.nl

Shopware 6 - Switching from development to production template

August 28, 2020 - 2 min read

I was a little bit confused by the terminology Shopware 6 uses for their development versus production template (read my blog that explains this difference here). I started out building a Shopware 6 webshop for a client on the development template, but I should’ve started with the production template.

So I needed to switch while we were half-way through the project. Here’s what I did.

  1. Clone the production template to a new folder; git clone git@github.com:shopware/production.git
  2. Checkout the correct version; git checkout v6.3.0.2
  3. Remove the .git folder; rm -rf .git
  4. Initialize a new Git repository; git init
  5. Go to your project that is based on the development template and find the Git commit hash for the first commit after you’ve committed the Shopware development template, let’s say it is 6ada1f
  6. Run git diff --name-only 6ada1f HEAD | grep -v composer
  7. Copy over the listed files from the development template project to the production template project
  8. Copy over the files and the public/js, public/css, public/fonts , public/thumbnail and public/media directories
  9. Open up both composer.json files and copy over the packages you’ve added (under require & require-dev) and the repositories you’ve added
  10. Run composer update in the production template project
  11. Run touch install.lock to let Shopware know we’ve already installed it
  12. Commit, and push to your Git repo. If you’re re-using the Git repo which stores your development template project, use git push --force.

I also had to deactivate and re-activate my theme plugin, but I’m not sure that’s needed for everyone.


Kyle Mathews

Written by Peter Jaap Blaakmeer @PeterJaap