Yes - I followed this guide here: Importing content from other platforms to Ghost
and I ran this:
migrate json-html-card my-posts.json
The result is perfect - the posts appear exactly as I need them to appear - just delays when trying to loop over them and delays the /ghost/… admin pages.
You mentioned Lexical so I thought maybe my use of mobiledoc is causing a problem. What I just tried is importing a sample post:
{
"meta": {
"exported_on": 1727543446000
},
"data": {
"posts": [
{
"id": 1000,
"title": "Cars",
"slug": "sample-cars",
"lexical": "{\"root\":{\"children\":[{\"type\":\"html\",\"html\":\"<div class=\\\"cars\\\"><h1>Welcome</h1><p>This is a sample post.</p></div>\"}]}}",
"feature_image": null,
"featured": 0,
"page": 0,
"status": "published",
"published_at": 1727543446000,
"published_by": 1,
"meta_title": null,
"meta_description": null,
"author_id": 1,
"created_at": 1727543446000,
"created_by": 1,
"updated_at": 1727543446000,
"updated_by": 1
}
],
"tags": [],
"posts_tags": [],
"pages_tags": [],
"users": []
}
}
and I get this error in ghost log:
ERROR Content import was unsuccessful
Does ghost provide documentation for how to follow a similar approach to:
migrate json-html-card my-posts.json
but instead of mobiledoc html card, put html content into the Lexical html child? - not sure what this part looks like for ghost’s editor:
"lexical": "{\"root\":{\"children\":[{\"type\":\"html\",\"html\":
I have only found this sample for the text child:
"lexical":"{\"root\":{\"children\":[{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"Hello, beautiful world! 👋\",\"type\":\"extended-text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"paragraph\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"root\",\"version\":1}}",
here: Migrating to Ghost - Developer Guide
Thank you again Cathy for mentioning Lexical!