In order to test Ghost as our possible new platform, I want to test-import some existing data. I can get a post imported from a simple json file ok. But, I have lots of old posts so I need to convert lots of existing HTML text to mobiledoc format. The HTML is in a .csv that can be run through javascript to do the conversion (if there is such a library), or using some other external tool.
I have tried to install npm install “@tryghost/migrate -g” but it failed with a raft of deprecated links and things. The result is it is clearly now outdated and doesn’t work.
Does anyone have any suggestions on how I can get simple HTML converted to mobiledoc format?
I have tried to install npm install “@tryghost/migrate -g” but it failed with a raft of deprecated links and things. The result is it is clearly now outdated and doesn’t work.
The migrate repo is extremely actively developed and used internally by the Ghost Team every single day. Perhaps you could share the error you ran into, and then we could help figure out why it didn’t install for you?
Beyond that issue, importing posts from JSON and a CSV file are not that different a problem, and there’s not a generic CSV import tool in the migrate repo atm… although there are lots of building blocks to make one.
If you don’t have lots of other processing to do, you could write a small wrapper to load the CSV into Ghost via the Admin API. If you do want to do more post-processing, handling images and so on, then you might want to use a pipeline approach like we do in the migrate repo.
Happy to dive into this more if you provide some more details of what you need.
Hello,
I run into the same problem with Andrew above.
I want to convert a JSON with HTML fields into MobileDoc fields.
I installed Migrate sucessfully despite some warnings. But when I run “migrate json html import.json” it shows error like this.
I reached out to our engineer who works on these tools. They updated the package. Can you update to the latest version (0.27.0) and let me know how it goes?
@RyanF can you please still comment on this?
I have exactly the same behavior on the latest (0.29.1) version. It seems to fall into try/catch (error) without really indicating what the error is. It is the same behavior for html and html-card, even on as simple file as: