I have used the local NPM Ghost tool to setup a simple website. I have added three users to Ghost. I have created a post with three authors. When I go into the Labs sections of Ghost settings and export my site data, the post’s JSON field reads “author_id”: “1”. This author_id of 1 refers to only one of the authors listed on the article. Where are the other authors being saved to in the JSON file.
I have explored Ghost’s codebase and found one comment, which may have been related to this issue here: https://github.com/TryGhost/Ghost/blob/main/core/server/data/importer/importers/data/posts.js
this.dataToImport[postIndex][targetProperty] = _.filter(this.dataToImport[postIndex][targetProperty], ((object, index) => {
return indexesToRemove.indexOf(index) === -1;
}));
// CASE: we had to remove all the relations, because we could not match or find the relation reference.
// e.g. you import a post with multiple authors. Only the primary author is assigned.
// But the primary author won't be imported and we can't find the author in the existing database.
// This would end in `post.authors = []`, which is not allowed. There must be always minimum one author.
// We fallback to the owner user.
if (targetProperty === 'authors' && !this.dataToImport[postIndex][targetProperty].length) {
this.dataToImport[postIndex][targetProperty] = [{
id: ownerUserId
}];
}
};
Are multiple authors exported by the export tool?
Thank you for your help!