Do new comments on old wordpress topics need a topic to match to on the discourse server?

(Keith John Hutchison) #1

I researching why comments are not turning up on the discourse server. I came across this in the documentation.

‘By default, posts are matched to Discourse topics through their discourse_topic_id metadata. That value isn’t available for posts published through WP Discourse prior to version 1.4.0. Enabling this setting will match posts with the post_type ‘post’ to Discourse topics through their titles.’

Does this mean new comments on old WordPress comments need a matching discourse_topic_id on the discourse server before the comments appears in the discourse server?

(Simon Cossar) #2

Comments from WordPress posts will not appear on Discourse. Discourse comments from posts that you publish to Discourse will appear on WordPress if you have selected the ‘Enable Discourse Comments’ option.

Are you able to publish posts from WordPress to Discourse?

To have WordPress comments converted into Discourse posts would require importing your WordPress database to Discourse. There isn’t an importer to do that yet.

(Keith John Hutchison) #3

We’re able to publish new posts from wordpress to discourse.
Testing if a comment on that post turns up in discourse.

(Simon Cossar) #4

Unfortunately the existing WordPress comments will not show up on Discourse. The only option the WP Discourse plugin has for dealing with existing comments is the ‘Show Existing WP Comments’ setting (found on the Commenting Settings tab.) If you enable that setting, existing WordPress comments will be displayed underneath the Discourse comments on your WordPress site.

(Keith John Hutchison) #5

Thanks Simon.

We know we can import the old posts and comments via the api.

(Simon Cossar) #6

If you need some code to get started with that, you could look at this: GitHub - scossar/wp-discourse-export: Export WordPress users and content to Discourse. It adds an Export tab to the WP Discourse admin section. It lets you export users, posts, and comments. It’s something I started working on a year ago, but didn’t pursue because I was concerned about having to deal with rate-limit issues. Before it can be used on a large site, some rate-limiting will need to be added to the API calls.

If you are going to try it, take note of the warning on the README. Be sure to backup your Discourse database first.

(Keith John Hutchison) #7

Cool and thanks Simon :wink:

We’re not working on the production site and we had to deal with the rate limits when we moved Sabai Discuss into Discourse. We ended up turning off the rate limits and turning the rate limits back after importing.