What’s the simplest way to set up a dev environment for a Shopify store. I’m trying to edit a Shopify store for a client that has a live Shopify site. I want to clone it and create a new version of the site in a dev environment – so I’m not editing a live site.
5
Answers
If you wish to edit the theme files, I suggest using Shopify Theme Kit. Therefore, connecting to the existing theme and duplicate to properly create and test your edits.
Every store comes with the ability to have up to twenty themes. You best bet is to make a deal with your client so that you get your very own DUPED or CLONED theme of their current production theme to work on. You then hook up your theme editing environment to that theme ID. You can then store all your work in your git, and push theme changes live to YOUR theme. Anytime you have anything great to show the client, they can PREVIEW your theme, using the live inventory and pages and blogs.
That way, no live production code gets hurt. The one drawback is if you invent new templates, they are not part of the live theme, so you maybe puzzled as to how to preview those. You have to make empty or fake versions in the live theme. You also have to clone or dupe products for example, to then assign your new templates to preview. It does suck, but the suckage is minimal.
So that is it. The best a developer can have. The shopify theme gem command line tool still works aces for me, YMMV. Do what makes you happy there.
Create a Shopify Partners Account.
https://www.shopify.com/partners
This will enable you to create stores from the partners admin. You can set up a dev store, then export your client’s live theme from within their store admin and import it on to your dev store.
You may not need a whole new dev environment to make your changes, though you might want to for test transactions/app integration. If it’s just simple theme edits, you can just duplicate the live theme on the client’s store and use ThemeKit or Shopify Slate for development, then set your theme as the live one when you finish edits.
https://shopify.github.io/themekit
https://shopify.github.io/slate/docs/about
You can use ThemeKit to achieve this.
"Actions" dropdown, click on
Duplicate
.available to add credentials for you working environments (if the
file does not exist just create it in the root folder). The contents should look something link this:
You would get these credentials while you’re installing the ThemeKit private app to your store.
https://shirtsthatmatchmypants.myshopify.com/admin/themes/593495501
where the number at the end is the theme ID.theme watch --env=dev
flag when you’re working behind the scenes. You can use the "Preview" link in the "Actions" dropdown of the theme’s duplicate from step 1 to see or share your changes. Then use thetheme deploy --allow-live --env=prod
flag when you’re ready to deploy your changes to the live theme.Here is list of points for clone store in dev store.