The product export problem
One of our clients reached out to us and asked if we could export a Shopify site. Then import it to BigCommerce. Upon we replied, of course, but there was a problem. The problem was, the Shopify store did not belong to the client.
They were going to become distributor/re-seller for the Shopify store owner in question. However without access to their website, it’s a bit tricky to import 500+ products with pictures.
Shopify Scraper with Python
After a quick look at Githhub, we found shopify-scraper. Which is a small tool to export anyones Shopify Store into an CSV file. So after a few line changes in the code and by adding a SSL connector we had it up and running.
On our first attempt we quickly had a nicely populated CSV file with links to Shopify’s CDN for product pictures. So the scraping was done.
Import problem from Shopify’s CDN
After some adjustments on the title row and categories of the CSV file we began the import. However, the pictures refused to import. If that was a block on Shopify’s end is unknown. Fortunately, we had it all there, the links to 500+ product pictures. So we had to try out something else. Of course with Python.
Download a List of Pictures with Python
Back to Github we found download-images-from-list-of-links. In other words, as the name reveals, this tool can download a list of images. In addition, it is already setup to take inputs from a CSV file.
After a few changes to the code, we downloaded the pictures with their original filename. Just like we had it in our original export file. After that and over 2GB later we uploaded the image files locally.
Find and Replace to Match New Path
Once we had the product images on our local BigCommerce server we made some adjustments to our CSV file. This to match with the new path of the products.
The function “Find and Replace” can be found in most spreadsheet programs. We used Google Sheets.
First you select the column you want to work with. Then start the “find and replace” function. After that, by adding regular expressions we removed the old path for every product. By doing this, we kept the original filename, for every product.
With the column still selected, we reuse the same function, but changed the search and replacement string with another regular expression, which added the new path behind the product picture name.
Import CSV to BigCommerce
A while later, we now have our new CSV file ready. By importing the products with the CSV file, all the pictures are automatically added.
This can probably be done by using paid plugins, like this from Litextention or maybe even free ones. But to source a plugin that works good can take a while. This method is blazing fast. And don’t forget, the main problem was that we had no login access to the Shopify Store.
For more information about our Web Development, SEO and Web Design services, please contact us on (213) 267-1914.