Manually copying over comments from Wordpress, how do I can create user accounts?

AI-generated summary

Migrating WordPress Comments to Discourse

Quintin_Par is migrating comments from WordPress to Discourse and wants to create user accounts for commenters without using the command line. simon suggests using the WP Discourse plugin to export users, but it’s not yet safe for a live environment with 1000 users. simon also mentions a plugin for exporting users, posts, and comments from WordPress to Discourse, but it needs rate limiting.

Quintin_Par wants to migrate comments while preserving their association with the original WordPress author by creating Discourse accounts for each of them. simon indicates that a create_discourse_user function will be added to the plugin, but it won’t handle multiple users.

Victor_Ashiedu asks if the WP Discourse plugin supports exporting comments and creating Discourse accounts for users. Jagster and pfaffman confirm that the plugin doesn’t support this feature. pfaffman offers a migration script as a solution, but it requires a budget. pfaffman also suggests looking at import scripts in the Discourse source code or his GitHub repository for ideas.

Key Takeaways:

  • The WP Discourse plugin doesn’t currently support exporting comments and creating Discourse accounts for users.
  • A migration script can be used to convert WordPress comments to Discourse comments.
  • Creating user accounts for commenters is possible, but handling multiple users requires a custom solution.
  • A budget is required for a migration script or custom development.

I am migrating my wordpress comments to discourse.

Is it possible to manually create a user account without touching the command line? I am outsourcing this task and can’t give access to the machine.

Yes, it can be done with php/WordPress. There is some example code here. It assumes that the WP Discourse plugin is activated. but it could be used without it by supplying values for the api_key, api_username etc.

Also, take a look at the Discourse API Docs.

Depending on when you need this done, the WP Discourse plugin needs to have an API function added to it for creating Discourse users. Once that’s in place, you’ll be able to call something like DiscourseUtilities::create_discourse_user( $wp_user ); That can be added soon, It’s needed for allowing the plugin to work with WordPress membership plugins.

I should have worded my statement better. It should have been: Can I create users without touching the code or commandline. Something a non-technical user can do it from the back or some admin section.
Is this possible?

How are you doing this?

Not yet, but it wouldn’t be hard to add an extension to the WP Discourse plugin to do this. How many users are on your site? Are they all being added to Discourse?

The easiest way to get your WordPress users onto your Discourse forum would be to use WordPress as the SSO provider for Discourse, but unless you have a reason for users to be logging into WordPress, migrating the users to Discourse would probably be a better approach.

You could also just send invites to your WordPress users through the Discourse admin section. You would risk losing some users by doing it this way.

With the wordpress plugin.

Around 1000 commenters and around 2500 comments. This is a blog.

So migrating the users to Discourse will automatically create accounts for them, right?
If that’s the case, my problems are solved.

I just wrote a plugin for exporting users. It needs a bit of work before it will be safe for a site with 1000 users. So far, it only exports users, but I think exporting posts/categories and comments is also possible. If so, it would be a cleaner solution for dealing with existing WordPress comments than what the WP Discourse plugin is currently doing. It could also be used for sites that want to completely move from WordPress to Discourse.

Thanks so much for this. This is a so good.

Exporting users, posts and comments from WordPress to Discourse works. The issue is that in a live environment the API calls to Discourse will have to be rate limited. That’s a solvable problem, but I’m not sure if it’s better to work on it, or to just develop a WordPress to Discourse migration script. I’ll have to get some advice about that.

I think that the WP Discourse plugin does need to be able to handle exporting large numbers of users. It’s needed for integrating with membership plugins.

@simon I was just looking at WP Discourse plugin (1.4.7). I don’t see this option. Is this not in production yet?

No, I haven’t worked through the problem of dealing will a huge number of API calls.

It sounds like what would work for you would be a full migration of your WordPress site to Discourse. Is that what you are trying to achieve?

I want to migrate the comments by preserving/associating them to the wordpress author (by creating discourse accounts for each of them). I was planning to create the user accounts manually. Since there was no way to migrate/synchronize this your comment gave me hope :disappointed:

Sorry, I was getting ahead of myself. A create_discourse_user function is going to be added to the plugin soon, but it’s not going to be setup to handle multiple users. There are a few different ways that it could be used to export a lot of users.

I think a full WordPress to Discourse migration script could be useful. I’ll look into it some more and get back to you.

In that case, what does this do?

https://github.com/scossar/wp-discourse-export

It exports a WordPress site to Discourse through the API, but it’s not safe to use in a live environment. It also doesn’t handle multi-level threaded comments correctly - note that the README says Work in Progress.

Oh I wish this was complete…

I think the solution is to modify an import script to pull the data over. It typically takes a day to get it done enough to know how much longer it’ll take to finish the job. If you have a budget, you can post in Marketplace or ask me. If not, the simple press importer is a decent place to start.

Thank you @pfaffman. I run a small no-revenue blog. Bit scared to post there :slight_smile:

Edit: Here’s the post:

@pfaffman Can you please take a look at [Paid] Migrating old wordpress comments and users to Discourse? If you have a quote, that would help me figure out next steps.

I was wondering whether this feature has been added to the WP Discourse plugin? I mean, does the WP Discourse plugin support exporting all current comments in WP and creating a Discourse account for all the users? It would have been good to be able to migrate all WP comments to Discourse instead of losing them.

Thanks all in advance

No, it does not any of those. AFAIK out there isn’t any free (or paid) tools to integrate comments of WP to Discourse. Creating accounts is easier task with DiscourseConnect but then you will loose all other ways to login to Discourse.

And again — I’m more than happy to be wrong again, but with comments I’m not.