In the Post object, how are `id`, `uuid` and `comment_id` related?

I’m importing posts from a Jekyll blog, which itself was converted from a WordPress blog. I’m using the “Universal Import” feature to mimic a migration from one Ghost system to another, and I have just about everything worked out. What I can’t figure out is the difference between id, uuid, and comment_id. Looking at the definition of a Post object, id and comment_id are identical. When I export a newly installed Ghost system, that’s also true in the export JSON for the new-installation-provided “Coming soon” post.

I can’t tell if id is some transformation of uuid or if the values are unrelated.

id is a bson object id, and uuid is a uuid. comment_id is normally identical to id, but might be different for pre Ghost 1.0 posts. The uuid is used for unauthenticated use cases, like post previews

Ah, thank you. So I can generate a bson object id and generate a uuid and don’t need to be concerned that id can’t be derived from uuid and vice versa?

Yes, that’s correct!

1 Like