{"id":1,"date":"2019-04-26T20:10:41","date_gmt":"2019-04-26T20:10:41","guid":{"rendered":"https:\/\/emersoncode.com\/blog\/?p=1"},"modified":"2019-08-07T19:53:43","modified_gmt":"2019-08-07T19:53:43","slug":"migrate-an-existing-shopify-theme-to-a-slate-theme","status":"publish","type":"post","link":"https:\/\/emersoncode.com\/blog\/migrate-an-existing-shopify-theme-to-a-slate-theme\/","title":{"rendered":"Migrate An Existing Shopify Theme to a Slate Theme"},"content":{"rendered":"\n<p>Slate is a great tool for faster and more efficient Shopify theme development.&nbsp; <br>However, if you want to bring a premium or existing Shopify theme to Slate, it requires a bit of extra work as the folder structure for Slate differs from the folder structure in the compiled Shopify theme. <br><\/p>\n\n\n\n<p>Here is a guide for getting started with Slate theme development when you already have a pre-existing theme to work with, whether the theme was built from scratch or is from Shopify\u2019s theme store.&nbsp; <\/p>\n\n\n\n<h4 class=\"wp-block-heading\">0: Assumptions<\/h4>\n\n\n\n<ol><li>You are using Mac OS X.<\/li><li>You are somewhat familiar with the Terminal and basic commands.<\/li><li>You will be using Slate v0.14 as at the time of writing this Slate 1.0.0 doesn\u2019t have the \u2019slate migrate\u2019 command. <\/li><\/ol>\n\n\n\n<h4 class=\"wp-block-heading\">1: Requirements<br><\/h4>\n\n\n\n<p>First things first, you must install:\n<br><\/p>\n\n\n\n<ol><li>NodeJS: Install it <a href=\"https:\/\/nodejs.org\/en\/\">here<\/a>.<\/li><li>NPM: Install it <a href=\"https:\/\/www.npmjs.com\/get-npm\">here<\/a>.<ol><li>You can alternatively use Yarn, but for this guide I&#8217;ll stick to NPM.<\/li><\/ol><\/li><\/ol>\n\n\n\n<h4 class=\"wp-block-heading\">2: Download your existing Shopify theme<br><\/h4>\n\n\n\n<p>Once we have our pre-requisites installed, we now need to download the Shopify theme we want to use with Slate. <\/p>\n\n\n\n<p>From your Shopify dashboard, navigate to Online Store &gt; Themes. Find the theme you want and under actions select \u2018Download theme file.\u2019 <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"615\" height=\"389\" src=\"https:\/\/emersoncode.com\/blog\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-26-at-5.33.51-PM.png\" alt=\"\" class=\"wp-image-22\" srcset=\"https:\/\/emersoncode.com\/blog\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-26-at-5.33.51-PM.png 615w, https:\/\/emersoncode.com\/blog\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-26-at-5.33.51-PM-300x190.png 300w\" sizes=\"(max-width: 615px) 100vw, 615px\" \/><\/figure>\n\n\n\n<p>The theme file will be sent to your Shopify account\u2019s email, where you can download and unzip it. <\/p>\n\n\n\n<p>While you\u2019re there &#8211; You\u2019ll want to grab the Shopify theme ID for that theme as well. I typically go to Actions &gt; Edit Code and you can easily see the theme ID in the URL of the Shopify Theme Editor page. Write this down for later.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"577\" height=\"31\" src=\"https:\/\/emersoncode.com\/blog\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-26-at-5.58.24-PM.png\" alt=\"\" class=\"wp-image-25\" srcset=\"https:\/\/emersoncode.com\/blog\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-26-at-5.58.24-PM.png 577w, https:\/\/emersoncode.com\/blog\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-26-at-5.58.24-PM-300x16.png 300w\" sizes=\"(max-width: 577px) 100vw, 577px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">3: Get Shopify App API Token<\/h4>\n\n\n\n<p>Next, we need to get API keys for our Shopify account so Slate can connect to our store and manage our theme\u2019s files.&nbsp; <\/p>\n\n\n\n<p>From the Shopify dashboard, let\u2019s go to Apps &gt; Manage private apps.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"483\" height=\"166\" src=\"https:\/\/emersoncode.com\/blog\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-26-at-5.34.29-PM.png\" alt=\"\" class=\"wp-image-26\" srcset=\"https:\/\/emersoncode.com\/blog\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-26-at-5.34.29-PM.png 483w, https:\/\/emersoncode.com\/blog\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-26-at-5.34.29-PM-300x103.png 300w\" sizes=\"(max-width: 483px) 100vw, 483px\" \/><\/figure>\n\n\n\n<p>Create a new private app, name it whatever you\u2019d like, and under \u201cAdmin API\u201d, select \u201cRead and write\u201d option for the \u201cTheme templates and theme assets\u201d field.&nbsp; <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"608\" height=\"85\" src=\"https:\/\/emersoncode.com\/blog\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-26-at-5.35.39-PM.png\" alt=\"\" class=\"wp-image-27\" srcset=\"https:\/\/emersoncode.com\/blog\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-26-at-5.35.39-PM.png 608w, https:\/\/emersoncode.com\/blog\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-26-at-5.35.39-PM-300x42.png 300w\" sizes=\"(max-width: 608px) 100vw, 608px\" \/><\/figure>\n\n\n\n<p>After your new private app is created, you&#8217;ll be presented with some API keys. The only key you need is the password field. Show it and copy the API password for later.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"614\" height=\"156\" src=\"https:\/\/emersoncode.com\/blog\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-26-at-5.37.44-PM.png\" alt=\"\" class=\"wp-image-28\" srcset=\"https:\/\/emersoncode.com\/blog\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-26-at-5.37.44-PM.png 614w, https:\/\/emersoncode.com\/blog\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-26-at-5.37.44-PM-300x76.png 300w\" sizes=\"(max-width: 614px) 100vw, 614px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">4: Create a config.yml file within your Shopify theme folder root directory<\/h4>\n\n\n\n<p>Open Terminal and cd into your Shopify theme folder. Once you&#8217;re within the main theme folder, create and open a file called config.yml<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">nano config.yml<\/code><\/pre>\n\n\n\n<p>You&#8217;ll want to insert the following into the file, using your own password, theme_id, and store url data.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"\" class=\"\">production:\n  password: b307811e1785b9fc811833e1a4fca991\n  theme_id: \"30872729910\"\n  store: production.myshopify.com\ndevelopment:\n  password: b307811e1785b9fc811833e1a4fca991\n  theme_id: \"30872729910\"\n  store: example.myshopify.com\n  ignore_files: config\/settings_data.json<\/code><\/pre>\n\n\n\n<p>Now press, control-x for the exit command, making sure to press &#8216;Y&#8217;, followed by enter\/return to save.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">5: Initialize NPM<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">npm init<\/code><\/pre>\n\n\n\n<p> Follow the prompts, and a new file will be generated in the root of your Shopify theme folder called package.json. You&#8217;ll want to open the package.json file with the text editor of your choice or with Terminal. (nano package.json)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">\"scripts\": {\n    \"watch\": \"slate watch\",\n    \"start\": \"slate start --env development\",\n    \"deploy\": \"slate deploy --env development\",\n    \"build\": \"slate build\"\n}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">6:  Install Slate<\/h4>\n\n\n\n<p>Within the root directory of your Shopify theme, run the following command in Terminal:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">npm install @shopify\/slate@0.14.0 <\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">7:  Run Slate&#8217;s migration command<\/h4>\n\n\n\n<p>\n\nWithin the root directory of your Shopify theme, run the following command in Terminal:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">slate migrate<\/code><\/pre>\n\n\n\n<p>Proceed through the prompts until the migration is finished.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">8:  Turn Slate on and start developing<\/h4>\n\n\n\n<p>Within the root directory of your Shopify theme, run the following command in Terminal:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">npm run start<\/code><\/pre>\n\n\n\n<p>If everything went right, you have now successfully converted your existing Shopify theme into a Slate theme which will allow you much faster development. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Slate is a great tool for faster and more efficient Shopify theme development.&nbsp; However, if you want to bring a premium or existing Shopify theme to Slate, it requires a bit of extra work as the folder structure for Slate differs from the folder structure in the compiled Shopify theme. Here is a guide for [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,2],"tags":[],"_links":{"self":[{"href":"https:\/\/emersoncode.com\/blog\/wp-json\/wp\/v2\/posts\/1"}],"collection":[{"href":"https:\/\/emersoncode.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/emersoncode.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/emersoncode.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/emersoncode.com\/blog\/wp-json\/wp\/v2\/comments?post=1"}],"version-history":[{"count":28,"href":"https:\/\/emersoncode.com\/blog\/wp-json\/wp\/v2\/posts\/1\/revisions"}],"predecessor-version":[{"id":50,"href":"https:\/\/emersoncode.com\/blog\/wp-json\/wp\/v2\/posts\/1\/revisions\/50"}],"wp:attachment":[{"href":"https:\/\/emersoncode.com\/blog\/wp-json\/wp\/v2\/media?parent=1"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/emersoncode.com\/blog\/wp-json\/wp\/v2\/categories?post=1"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/emersoncode.com\/blog\/wp-json\/wp\/v2\/tags?post=1"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}