Migrating 6000 users from existing site to Discourse forum before taking site offline

I have just over 6,000 users on a site that I am going to sunset that I want to migrate to a Discourse forum that is already up and running and connected to the site via a toolbar link.

Some of the sites 6,000 users already have forum accounts but most don’t. The way it works is that if you are logged in to the site and click the Forums link in the toolbar, you can use your site credentials to log in to your Discourse account, which is created automatically (I assume, I didn’t do the SSO coding).

Once the site is offline we are going to redirect everyone to the forum.

Prior to that I would like to export my 6,000 user’s emails and names from my site’s MongoDB database and:

  1. Import them into my forum’s Discourse database
  2. Automatically create an account for each imported user
  3. Force each user to select a new password when they log into the forum for the first time

Has anyone done this or have any suggestions on the best way to proceed?

I have also read about the Bulk Import feature. I would prefer not to go that route but if that is a the quickest/easiest way to get existing users to create forum accounts I will go try that.

Thanks in advance.

I have done a similar import recently. In my case i had a SQLite db.

I built off some of the scripts there to satisfying my own requirements. There are some good guides on how to run import scripts on this forum. When users rejoined they had to use the “forgot my password” with their original email account to regain access.

Maybe there is an easier way to just import user accounts specifically but I can only speak to my own experience

1 Like

As @piffy recommended, what I would do is write an import script using one of the existing scripts as a model. It looks like the nodebb script uses mongodb, so I’d probably start with that one. If you’re a programmer you can probably make sense of the existing code, even if you don’t know ruby. If you are not a programmer and have a budget you can post in marketplace or see Redirecting….