How to export all files from Shopify

If you are cloning a Shopify shop you would usually do it by exporting the theme, and importing it on another Shopify instance. Once you view the website on the new Shopify instance you will notice that the images and other files on the homepage and other pages are not included. Here is a fairly simple guide to how to export all images and other files from Shopify. I use Chrome as a browser, if you are using another browser it might work slightly differently.

1. Go to Settings -> Files

    1. Change the URL to show 250 files. Should look like “/admin/settings/files?limit=250”
    2. Right-click and click on “Inspect”
    3. In the inspector click on “Console” and paste this script:
      function fetchPageAssets() {
      let images = document.querySelectorAll(‘img[src*=files]’);
      images.forEach(function(image) {
      files.push(‘<img src=”‘ + image.src.replace(/_60x60/, “”) + ‘”>’);
      });
      }function downloadListFile() {
      let button = document.createElement(“a”);
      let data = ‘data:application/octet-stream;base64,’ + window.btoa(files.join(‘\n’));
      button.id = “download-file”;
      button.href = data;
      button.download = “shopify-files.html”;
      document.querySelector(“body”).append(button);
      button.click();
      }
      var files = []
      files.push(‘\n’)
      fetchPageAssets()
      files.push(‘\n\n’)
      downloadListFile()Hit Enter to Submit
    4. Your browser will now download a HTML file

2. Open the HTML file

    1. use an extension such as https://chrome.google.com/webstore/detail/simple-mass-downloader/abdkkegmcbiomijcbdaodaflgehfffed to download all images.

3. Repeat

    1. If you have more than 250 files, you will need to browse to page 2, 3 etc. in files in Shopify and repeat the steps, until you have downloaded all images.

4. Upload files

    1. Once all files are downloaded you can upload the files to your new Shopify instance

5. Edit path in your theme

    1. If you want to save some time you can do a search and replace in the settings_data.json file in your theme to point the images to the new path.
    2. Once you have edited the path all images on the homepage and other pages will magically show up on your new Shopify instance

Leave a Reply

Your email address will not be published. Required fields are marked *