Episode 19 - Protect your Shopify Theme

Subscribe to the Podcast

Listen on Apple Podcasts Listen on Google Play Music Listen on Spotify Listen on Stitcher Listen on RSS

The Podcast

 


Show Links


Transcript

Hello Scott Austin here.

Your theme is a pretty important part of your Shopify store experience and one of the great things about themes and Shopify is that we get complete control over the code of the theme. First, the developer creates the theme code that we then add to our store, but then the theme can be updated to meet your business needs. Updates can come from a variety of sources including you and your team members, Shopify experts that you hire to improve your site, apps that you add to your store and customer support teams from the apps that you've added to your store. In a busy complex store, it's a lot of people changing the theme and that many fingers in the pie can be quite a problem with multiple people making changes for multiple reasons. There is a high risk that something will break and with so many people in the theme and the basic complexity of the theme, it may be hard to figure out what changed to the theme is the cause of an issue you may be having.

So in this podcast episode, I'm going to cover three different ways to back up your theme and discuss the pros and cons of each and those three methods are in order of ease of implementation. The easiest being the first one, which is making copies of your theme in the Shopify admin. The second option is to use a backup app from the Shopify app store and the third option, which is the most complex one, is using theme kit and get hub. So let's go into each one of these in detail. The first one is to make a copy of your theme in the Shopify admin. It's super easy to do in the theme section of the Shopify admin. There's an action button next to each of the themes in your store. Just click on that action button and select duplicate. And Shopify will make a copy for theme.

So if there's a problem in the future, you can publish the copy that you just made and we'll take your theme development back in time to the point that you made the copy. Here's a couple of things to think about when using this method. First is that you can only save 20 theme instances in a Shopify store, so you just can't keep making copies forever. Some cleanup and deleting of old copies will be needed. Second is that you will need to name each copy so you know which version it is. I recommend that you not overthink the naming too much and avoid explaining what is in the version of the theme in that theme name instead, just use a date. For example, let's say the current live version of the theme is named turbo August, 15 2019 if you make a copy on September 10th the copy will automatically be named too.

Copy of turbo August 15, 2019 take that live version of theme and name it to today's date, so turbo September 10, 2019 and then change the copied version to be that old, which is turbo August 15, 2019 that way it'll be easy for you to figure out the ordering of your theme copies, so the pros of this backup method are that it's easy to use and it has no cost associated with it. The cons, however, include that there is no automated process. You have to manually create these copies. Also you can't compare theme versions to see what files were changed between these different versions or copies of the theme and there's a limited number of theme copies that can be made in your Shopify store. Let's move onto the second backup method and that is that there are apps available in the Shopify app store for backing up your theme.

There are currently at least seven apps available to choose from, but I'm only going to talk about two of them now. I've not used any of the backup apps so I don't have firsthand knowledge of them, but I did look them over and did some research for you. I'll include links to both of the apps in the show notes. The first app is called theme watch. It does automatic and manual backups of your theme. One of the features I really like about it is it allows you to compare different versions of a theme file side by side. This is really helpful and trying to troubleshoot the cause of a problem. As you can see line by line what changes were made to the file. That said, I'm worried that this app only has four reviews in over a year and a half in the app store. All those reviews are five stars, but it doesn't look to be like a popular app for store owners.

The pros of theme watch are that it automates the backup process and you can compare file versions so you can see what changes were made. It's relatively affordable at $3 per month per theme. The cons for theme watch or there's not a lot of use of it in the app store. The second app is called rewind backups. Now rewind is a lot more than just backup themes. It also backs up most of your stores, other data types, including things like products, collections, orders, customers, menus, and more. This is a much more popular app in the app store and generally gets very positive reviews, but it does not let us see what code changes were done to the theme files. This app is highly regarded by many people in the Shopify ecosystem, so the pros for rewind are that it automates the backup process and it backs up most store data, not just the theme.

The cons for rewind are there's no tracking of changes at the file level and it gets expensive quickly. Well, it starts at $3 per month for small stores. It quickly goes up to $300 per month for stores with more than 2000 orders per month. Let's move onto the third and last backup method. It's a little more technical than the others, so it's not meant for everyone, but it is very powerful for those that choose it. This is the method that I use for all of my clients and to save them a number of times. The method uses a service called GitHub.  GitHub is a source management tool, which means that it allows developers to track every change to the code in a project. In this case, the project is your theme and GitHub is a ubiquitous tool used by just about every developer.

And then there's a second tool called theme kit that's used in conjunction with GitHub.  Theme Kit is developed by the Shopify team and allows developers to work on Shopify theme files on their local computer instead of through the Shopify admin. So here's how the two tools get used together. We use theme kit to create a copy of our store's theme on our local computer and then we use GitHub to source manage the local copy of the theme on our local computer. Those two processes are manual and separate, which gives us a lot of control over the granularity of changes that get tracked. Here's some things to think about when getting this set up. Theme kit uses the Shopify API to gain access to theme files, so you'll need to create a private app to access the API. The only permissions the app needs is read and write for the theme templates and theme assets.

And a side note here on private apps to create a private app in the Shopify admin. Your account will need full access or permissions to the store. If you're the account owner, you'll be fine, but if the staff account or collaborator account with limited access, that account will not be able to create a private app. If that's the case, when you click on the [inaudible] manage private absolute link in the app section of the Shopify store admin, you'll see an error message where you can request access. Just know that the permissions to apps won't be enough. You'll need full permissions across all access settings to be able to create a private app. When setting up theme kit on your computer, you'll create a configuration file called config.yml.  Yammel is the way I say the dot YML extension of the file. In that configuration file, you can list certain theme files will be excluded from being duplicated onto your computer and there's one file that you should exclude and that is settings underscore data dot Jason, which is in the themes config folder.

This is the file that stores all of your theme settings like colors, fonts, and homepage layout. You want to include it as that file should only be edited by using the Shopify admins. Customize theme function. You don't want to edit that file locally. Having an excluded from being downloaded by theme kit means you won't accidentally overwrite the file and lose your most recent theme setting changes and in your get hub configuration you will want to exclude the config dot Yammel file from being tracked. That's because the file contains the password, your private app, and you don't want people to have access to that, especially if you're using a free get hub repository that is public, which means anybody can look at it. If someone had that password, they can make changes to your theme or outright delete it. The pros of the get hub theme kit backup method are it provides a complete record of all changes made to the theme.

It gives you the robust ability to restore the theme to any previous state. It also allows you to work on theme files on your local computer and there's no app fee. The cons are it's a technical solution that requires developer experience and there's no automation. Backups are only done manually. Now, why the get hub theme kit method may be too complex for the average store owner with no dev skills. I'd recommend that any store owners that are working with a Shopify expert ask what method, if any, the expert uses to track code changes. They should be using a method that allows line by line tracking changes to the theme. For me, this level of tracking allows me to see in troubleshoot all the changes that I make to a theme, but even more importantly, it allows me to see what changes are made by others and that has been real useful.

Many times a client will come to me and say that something is now broken on their site and I may have not worked on their site in months or even years, but I can do a quick code sync and then see every change that has been done to the theme since I last backed it up, which helps me troubleshoot the issue regardless of which method you use to backup your theme. Here's some suggestions on when to backup. The first one is before adding a new app. This is because apps can make automatic changes to your themes. So having a copy will allow you to go back to the state of the theme before you added the app. In case you decide you don't want the app. And this is important because uninstalling an app does not uninstall the changes it makes to your theme. Shopify doesn't allow apps to undo changes they make to themes a second time.

To back up your theme is when touching the theme code for the first time in a while. This allows you to see what changes others have made to the theme while you were not working on it. Third reason is when done making your changes to the theme code and that way you have a record of all the changes you've made to the theme. And the fourth one is when giving access to a new person or customer support team. This is a good safety precaution in case they are untrained or reckless. So in summary, backing up, your theme is highly recommended as one small error can take your business down. There are many options you can use to back up your theme. And each one has its own pros and cons. For the non-technical folks, I'd recommend the theme watch app and for the technical folks, I'd recommend the GitHub / Theme Kit solution. Either one of these will give you the level of control you need over your changes to troubleshoot issues and a rollback if necessary.

That's it for theme backup. Thanks for listening.



Jade Puma is a certified Shopify Expert. If you need any help with your Shopify store, we can help.


Stay in the Know