A New Squarespace to Ghost Script

A New Squarespace to Ghost Script

When I wanted to move from Squarespace to Ghost, I ran into a problem: there is no built-in way to migrate. You either have to work with their Concierge service, or roll-your-own. Naturally, I decided to roll my own.

I came across this script by Simon Facciol, and based my approach on that. I enlisted the help of some friendly AI, and made a few additions:

  1. I made it re-runnable, so I could add enhancements and just re-run it. This includes handling some concurrency errors in the post editing process. I also added some other QoL/Logging functionality to make life easy
  2. I added support for pages as well as posts, so I could get everything in one go
  3. I included the ability to download the images from Squarespace, add them to Ghost, and re-write the URLs

It's not 100%, but it gets you a lot further in the process, leaving a trip through posts to just clean things up. I ended up needing to fix some image galleries, re-do some formatting, and re-made the pages to be a bit more 'native', but all-in-all this saved a few hours of work.

Readme

To use these, you need to:

  • Create index.js and package.json from the code below
  • Run npm install in the directory
  • Export your site from Squarespace (its a Wordpress export), put it in the same directory, and name it squarespace.xml
  • Replace the url and key variables with your Ghost API url and key from a Custom Integration
  • Run node index.js and watch your posts roll in