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


(Quintin Par) #1

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.


(Simon Cossar) #2

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.


(Quintin Par) #3

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?


(Simon Cossar) #4

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.


(Quintin Par) #5

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.


(Simon Cossar) #6

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.


(Quintin Par) #7

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


(Simon Cossar) #8

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.


(Quintin Par) #9

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


(Simon Cossar) #10

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?


(Quintin Par) #11

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:


(Simon Cossar) #12

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.


(Quintin Par) #13

In that case, what does this do?


(Simon Cossar) #14

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.


(Quintin Par) #15

Oh I wish this was complete…


(Jay Pfaffman) #16

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.


[Paid] Migrating old wordpress comments and users to Discourse
(Quintin Par) #17

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

Edit: Here’s the post:


(Quintin Par) #18

@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.