I believe it would be possible to write a script, but there are a few caveats.
I’m looking at the comments table in the database, which is where all of the comments are stored.
The fields that need to be populated for each comment are:
-
id- ID of the comment, which is automatically generated for each comment -
post_id- ID of the blog post the comment belongs to -
member_id- ID of the member who posted the comment -
parent_id- ID of another comment if the comment is a reply to that comment -
status- Should bepublishedif the comment is live -
html- Contents of the comment with any HTML tags (paragraphs, etc) -
created_at- Date and time comment was created -
updated_at- Date and time comment was updated (would be same as created if never updated)
The caveats are:
- Can you export comments from Cove? If so, does each comment contain the ID of the Ghost blog post the comment belongs to? This is required in order to make the association between blog post and comment.
- There are no anonymous comments in Ghost, meaning before each comment is inserted, a corresponding member needs to be created in Ghost, and that member’s ID needs to be stored with the comment.
- To create a member, you’d need the comment author’s email and name from Cove.
- Ensure you have a free membership available on your Ghost blog so that each member can be assigned to that.
- If a comment is a reply to another comment, the parent comment needs to be inserted first, so that the parent ID is available to be stored with the reply comment.
Something else to think about is that because you’d be creating a new account for each commenter, they won’t be aware that an account is being created for them.
Along the lines of transparency, you may either want to reach out to those members for permission or let them know that you’ve migrated their comment, which resulted in them having an account created on your website.
That way, if they ever get a newsletter from the Ghost website or an email from you, it won’t be a surprise.
If I were writing a script, I would approach it as follows:
- Export all of the comments from Cove, and if possible, include the Ghost blog post ID with each comment.
- If I didn’t get the data in this format, I would try to figure out what in the export I could use to reliably associate a comment with an existing blog post in Ghost (maybe post title), and then extract the blog post ID in real-time during the import or build an index to be used by the importer.
- I would sort the Cove comment export by date, effectively ensuring that parent comments are imported first, so that any replies can look up the corresponding parent ID to keep that association. If you didn’t care about that, you could simply import all comments as top-level comments.
- Build a CSV file with all of the comment authors and import them into Ghost via the UI. Then, when comments are imported, you already know all members exist, and each member’s ID can be looked up with their email address.
Now, I haven’t imported or migrated anything into Ghost, so these are just my initial thoughts based on the limited information I have.
In summary, I think there is a way and I hope you succeed! ![]()
#ChocolateIsLife