Migrating from Ghost CMS to Kirby

I would like to migrate from Ghost CMS to Kirby because of more flexibility and multi-language features but I cannot find a theme that works similar (two-column layout with blog articles on the left and widgets on the right side) as my current theme Mapache.

Another issue is the migration itself. I have exported all the content from Ghost to JSON and then used ghost-to-md to convert it markdown files but now I don’t how to use that output in a Kirby friendly way.

Are there more information somewhere about these two topics?

Theme: Theoretically, you should be able to reuse the theme when you translate it to PHP or even with a plugin using Handlebars (Handlebars Templates | Kirby).

Migration: You can programmatically create pages and subpages using Kirby’s API:

Thanks for the quick support but I am afraid I have not enough knowledge to make that work as I am more a “script-kiddy” than a developer or designer and I am completely new to Kirby.
I just took a look at the feature set and tried the demo and found it quite nice.
Is there some documentation how to use this?

There is no ready to use script I’m afraid.

But from the example in recipe @pixelijn already linked to (particularly this part: Creating pages from frontend | Kirby), you should hopefully be able to achieve this.

Basically, you would loop through your data and then use the createChild() method to create pages from it. Not knowing the structure of your data (nor what you get out of Ghost), it’s hard to give general advice. Creating the pages itself via Kirby’s API is rather straightforward. I guess the more difficult part would be to actually store the data in a useful way (depending on what the resulting Markdown looks like).

The json export is a very long one-liner which looks like this (short snippet):

Hobbyfotograf.","website":null,"location":"Berlin","facebook":"fniedernolte","twitter":"@MaluNoPeleke","accessibility":"{\"nightShift\":true,\"whatsNew\":{\"lastSeenDate\":\"2021-02-03T16:27:00.000+00:00\"},\"launchComplete\":true}","status":"active","locale":null,"visibility":"public","meta_title":null,"meta_description":null,"tour":"[\"getting-started\",\"using-the-editor\",\"featured-post\",\"upload-a-theme\"]","last_seen":"2021-03-23T13:25:41.000Z","created_at":"2019-03-30T23:35:55.000Z","updated_at":"2021-03-23T13:25:41.000Z"}],"webhooks":[]}}]}

The conversion to markdown gives me a folder with three sub-folders: page, post, tags.
Inside of that are more sub-folders:

/page
-/ux
-index.md

---
title: User Experience
slug: ux
date_published: 2019-04-28T07:09:15.000Z
date_updated: 2019-04-28T07:10:32.000Z
---

# User Experience


# User Experience

Test

---
Tags:   
date_published: 2019-04-28T07:09:15.000Z  
date_updated: 2019-04-28T07:10:32.000Z   

/post
-/examplepost
-index.md

---
title: example post heading
slug: mosaik
date_published: 2016-01-14T08:05:33.000Z
date_updated: 2016-08-05T08:55:00.000Z
tags: example, post
feature_image: __GHOST_URL__/content/images/2016/08/once-upon-a-time.jpg
---

# example post heading

![](__GHOST_URL__/content/images/2016/08/once-upon-a-time.jpg)


# example post

> example
> 
> post

2015

---
Tags: [example](../../tags/example.md), [post](../../tags/post.md),   
date_published: 2016-01-14T08:05:33.000Z  
date_updated: 2016-08-05T08:55:00.000Z   

/tags
-ux.md

---
title: UX
slug: ux
---

# UX




Pages: 


* [page/portfolio](../page/portfolio.md)

Additionally I have a folder “images” with folders per year and month (e.g. /images/2021/03/image.png) + another one called “size” (e.g. /images/size/w300/2021/03/image.png).

Now I am not sure how to transform that into the right format for the mentioned API calls.

Some more detailed help here with the mentioned concrete example would still be much appreciated.

I wouldn’t convert that to markdown but create an array from the json string, then loop through that array (or the relevant parts of it) to create your pages.

Then it’s just a matter of creating the data array for each page and create the page with that data as outline in the sources listed above.

As I have not enough knowledge how to do that, do you think it could be achieved by using the Ghost API directly or with this or this plugin?

Yes, that would all be possible, I’d say. But even with those solutions you would have to do some coding, as all these options don’t import your Ghost blog magically into Kirby, I’m afraid :wink:

The rest API will also only give you some JSON you have to do something with, which will probably not be very different from the big JSON string you already exported, only distributed across multiple endpoints.

The more important stuff that you should do first, at least from my perspective, is think about the data structure/information model you want in your new Kirby site. Then you know what information from your old blog has to go where.