Hashnode to ghost migration

Hashnode has now gone pro-only for some features. Is there some method to import my hashnode posts to ghost ?

I intend to use Ghost 6 on an OpalStack VPS.

Almost certainly. Does Hashnode have an export format?

There are useful tools in the @tryghost migration repository, and gctools is another good resource.

There is an option to “Back up your articles and drafts to a GitHub repository” - but right now that’s under the PRO option only but I seem to have all my articles backed-up to my private GitHub prior to the PRO date. The articles are in .md in this format :

---
title: "xxx"
datePublished: Wed Mar 04 2020 10:37:34 GMT+0000 (Coordinated Universal Time)
cuid: xxx
slug: xxx-xxx-xxx
tags: xxx, xxx, xxx

---

Blog Content here

So, yes I have a list of all my posts as md files on my GitHub which is downloadable.

The ghst CLI might be a good place to start, if you have .md files:

Somebody also shared this tool they’ve build, which looks like it has a few more options, though it’s pretty new:

Using the ghost CLI :

ghst post create --markdown-file ./post1.md

Do I need to edit anything for ghst to ‘recognize’ the hashnode arguments - sync with the ghost parameters ?
title, datePublished, cuid, slug, cover, tags


title: “xxx xxx”
datePublished: Fri Jan 31 2025 08:48:00 GMT+0000 (Coordinated Universal Time)
cuid: xxx
slug: xxx-xxx-xxx
cover: https://cdn.hashnode.com/path/to/images/xxx.jpeg
tags: xxx, xxx, xxx


Blog Content

I don’t think it can do that out of the box. Not sure if any existing tool for Ghost can.

So, I’d use them as starting points − I don’t think there is a plug-and-play solution.

So where’s my starting point to writing scripts in JavaScript to import a a bunch of .md files and sequentially run ghst post create --title `${post_title}` --markdown-file ./hashnode/post-1.md or something like that ?

If you’re comfortable with Javascript, the easier path would probably be a script that parses through your .md files and then talks to the Ghost Admin API directly:

Without ever having done this, this looks like something you’d want to use:

https://www.npmjs.com/package/gray-matter