Generate Comment IDs for import

Hi,

I’m migrating from WordPress to Ghost and have to move 9000 comments.

The steps I will take:

  1. Import content through the interface
  2. Import users through the interface
  3. Export the comments table from the Ghost database
  4. Export the users table from the Ghost database
  5. Match the generated Post_ID and generated User_ID to the comments from WordPress.
  6. Import the comments to the Ghost database.

Question: The comment ID of Ghost is a string of 24 characters. How is this generated and have someone an idea to mimic this, before step 6? Or can i use random other IDs, like wordpresscomment0001

I believe they’re from here:

Sounds like an interesting project!

Check, it is a random number, and only needed to link comments to parent comments.

Oh yes, really interesting. will probably do a complete write-up after the site is live next month :slight_smile:

For this who are reading along and also looking for importing comments/ users;
if not all of your members agreed to creating an account for comments, or details are incomplete. You can import NULL for the user_id to the comment, it will accept this and display the comment as from ‘deleted member’

1 Like