Bulk Post Importing

Hey Ghost Developers

I trust you are all well :slight_smile:.

When can we expect changes to the current bulk post upload? Going from Ghost 1.0, to upload and then upgrade to Ghost 2 is somewhat complicated and increases the likelihood for errors.

I’ve been trying to follow the instructions for uploading and the @tryghost/migrate tool doesn’t seem to change the “html” field at all so I have no content when uploaded.

Is there an easier way to bulk upload posts?

Matt

Can you back up a few steps here and explain?

Bulk upload isn’t a feature that’s supported in the Ghost API except via the importer. If you’ve got API code that’s simulating bulk upload by doing multiple requests, that’s cool!

If your API code isn’t working how you expect or you’ve got a problem, can you share the code and the problem?

Equally, if you’re trying to use the @tryghost/migrate tooling and that’s not working for you, please share what you’re doing and what’s not working and I can help.

Hey @Hannah thanks for the prompt reply.

I have worked out the issue with my @tryghost/migrate. The “posts” field wasn’t correct. My apologies for that one!

My main question is when will the bulk upload feature be available with more user-friendly functionality? At the moment, the JSON Importer from Labs isn’t a simple tool to use and takes a considerable amount of time to set up for importing.

Matt

If you see edit and add routes methods here:
https://github.com/TryGhost/Ghost/blob/master/core/server/api/v2/posts.js

you can see that ugly frame.data.posts[0], that not make sense to me the api contract require a collections to use only the first item and ignore the rest, Its not make intuitive, but im not know it this is a work in progress.

If you are running a custom instalation, you can edit this file and add your custim import logic.

i suggest you create new method with a contract as:

[
   { method: "add", data: { "post attributes here" } },
   { method: "edit", data: { "post attributes here" } },
   { method: "delete", id: idhere }
]

Are you need edit other files, probably in about jsonSchema, of course its not to simple as im talk here…

I can help you in this develpment if are interested, its useful to me too.
A bulk Api can aid the core team to leave migration scripts to community and concentrate your works in core.

There’s no plan to add bulk actions to the API at present.

I’m interested in a couple of things here:

  1. what is the use case for adding multiple posts at the same time?
  2. what is the problem with using the API and sending multiple posts in sequence?

The migration / import tooling is intended for one-off usage when you first move to Ghost. The API allows for creating or publishing posts regularly. At the moment I’m not aware of that many people using the ability to send a single post via the API and so I’m keen to understand what’s holding people back from using the API as it’s currently intended.

Hey @Hannah

Thanks again for getting back to me. You guys and gals run a great community here.

  1. We have just purchased a website which posts quotes (quotesaday.com). It’s currently on WP but I’m looking to move over to Ghost as it’s my preferred platform. This is my first time developing a custom theme so I’m working my way through it using your docs which have been helpful thus far.

So, we create the quotes in bulk via Google Sheets and then upload them as CSV to WP. I’m trying to find a similar solution for Ghost. At the moment I’m still setting everything up in Sheets, then exporting as CSV, converting to JSON, running through @tryghost/migrate and then uploading the file via the Importer. As these are quotes rather than regular posts, we have a ton to import regularly. I’ve almost finished the layout and functionality, but bulk uploading the content is my biggest stumbling block at this stage.

  1. Not sure which API you are referring to?

Thanks for the background info - this makes sense.

The API I’m referring to is our admin API:

https://ghost.org/docs/api/v2/admin/

It’s specifically designed for being able to send individual pieces of content to Ghost. It doesn’t have bulk update so you’d need to iterate and make multiple calls, but it would save you from manually running migrate tools & uploading files.

Hi @Hannah,
What you said makes more weird a api contract that receive a array of one item.
What was the thinking behind this contract ?
And where I can find the roadmap with plans of next features that are developed ?

The need o an bulk api is to process a large amount of data without overhead of multiple http request, but in batches…if data is really large produce a enormeus json to upload require a big resources , that web proxies need to be configured to accept that large upload a absurd timeout.

Thanks @Hannah

I’ll have to spend some time looking at this. Doesn’t make sense on first inspection.