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.
- Clone the production template to a new folder;
git clone git@github.com:shopware/production.git - Checkout the correct version;
git checkout v6.3.0.2 - Remove the .git folder;
rm -rf .git - Initialize a new Git repository;
git init - 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 - Run
git diff --name-only 6ada1f HEAD | grep -v composer - Copy over the listed files from the development template project to the production template project
- Copy over the
filesand thepublic/js,public/css,public/fonts,public/thumbnailandpublic/mediadirectories - Open up both
composer.jsonfiles and copy over the packages you’ve added (under require & require-dev) and the repositories you’ve added - Run
composer updatein the production template project - Run
touch install.lockto let Shopware know we’ve already installed it - 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.