JSON file structure
First and foremost, your JSON file must contain valid JSON. You can test your file is valid using the JSONLint online tool. The file structure can optionally be wrapped in:meta
and a data
object.
The meta object
meta
block expects two keys, exported_on
and version
. exported_on
should be an epoch timestamp in milliseconds, version should be the Ghost version the import is valid for.
The data block
Ghost’s JSON format mirrors the underlying database structure, rather than the API, as it allows you to override fields that the API would ignore.post
with id: "1234"
and a posts_tags
object which references post_id: "1234"
, then those two things will be linked, but they do not relate to the post
with id: "1234"
in your database.
The example below is a working but simplified to cover most use-cases. To see what fields are available, types, lengths, and validations, please refer to the Ghost schema on GitHub.