Cross reference csv userlist against new users

Continuing the discussion from Export all users (from all time):

Our forum is a spin-off from another (much larger) forum… 75% of our users come from the parent forum, so we are trying to reserve usernames used there for registration on the new forum.

This is to create consistency across platforms but also to prevent trolls from snatching up the names of established users.

Does anyone know of a way to setup Discourse to cross reference a csv list of 56k users?

Desired result - When a user signs up to the new forum, if they have chosen a name on the other forum, place them in a group , else place them in a different group.

In both cases, set that group as primary.

Users detected as having a matching name get tagged as “pending verification” and are then required to send us a PM on the parent forum to verify they setup the new profile with the same name.

If not possible within Discourse, is there any 3rd party software that could automate the process instead?

Our current process sees all new users automatically tagged as “Verification not started” until we manually check their name against the list… which is obviously not sustainable.

Thanks in advance!


Import all the users. Put them in the group. People who have accounts can do forgot password to log in. Everyone else creates a new account normally.


Thanks Jay, I can see how that would work but we really don’t want to fill our forum up with that many users… out spin off is still small (600 users, growing by 20 a day) and it would kinda throw our stats out the window.

I’m also conscious that people get confused by even the most basic instructions :scream:, will find their name taken and create a profile with a different name instead of taking control of theirs.

Is there a CSS function to add someone to a group and apply that group as primary? Or is CSS only really for appearance, not action?

I forgot to add, the parent forum is a corporation, their admins have kindly shared the username column of their exported list, but not the sensitive info like email address, real name etc… so we don’t have enough data for an import.

Bit of a sledgehammer to crack a nut … but could you implement SSO across the two forums with the large original forum doing the authentication against its user list?

This would establish a single unique database and you would also be able to link the activity of members in both …

not sure whether your 25% would be able to register on the original forum as well … but just a thought

Thanks, the larger forum could never allow a link like that… they fully support our spin-off (hence sharing the userlist) but being a corporate structure with massive privacy implications etc. an actual link could be a PR nightmare for them…

We’re coping with the manual verification for now, and have a semi-efficient system working to a fashion… I was just hoping their might be a better (fully automated) Way.

Our current method is as follows:

  • Our Confirmed user groups all contain an underscore ‘_’ so we are using CSS to automatically label new users (i.e. those not in a group yet) as “verification not started”


.topic-post.regular:not([class*=_]) .username:after {
content: “user verification not started”;
/* … */

  • all new users are asked (via welcome email and a pinned banner post) to send me a PM on the parent forum if they have a matching name, I can then manually add them to our ‘Confirmed_ST_User’ group.

  • On a weekly basis, I export our user list and paste the data into a spreadsheet I’ve created, that cross references the names using a VLOOKUP formula. It gives me a yes / no answer for each line, so I can then filter down to matching users not already in a verified group.

  • I Copy paste the results into the bulk add to group window and add those users to the ‘Pending_Verification’ group… another block of CSS tags them as follows:


  • Non matching names are filtered in the same way and pasted into the ‘Comfirmed_non_ST’ group clearing the red flag.

  • I send pending users a PM on the parent site (in batches of 25) and when they respond I add them to the ‘Confirmed_ST_User’ group.

  • if they don’t respond I send a second PM, followed by an email and eventually a forced name changed to something unique.

Not as bad as it sounds, but would certainly be nice to automate the cross referencing part.

I’d create a script that updates the groups via the API.

And I’d be tempted to find some way to automate getting data from the old forum, like having them paste a link to their new user profile, but that’s a little complicated to train people for.

1 Like

Is there a sql script that could be created that can check a username against an xls file or fully imported list in sql that can do one of two things:

When user signs up, discourse already can put an account on hold for admin verification. Is there a way to write a custom plugin that functions through that rule/option that will say:

  • check username against forum2 master list.
    • if user is in group 1 (matching name) place user into a group (verification_required_conflicting_username)
    • if username not in master list, place user into group (confirmed_non_conflicting_username)

Either way set a rule (plugin or sql code) that auto confirms the user’s forum account (our forum) for immediate use, but dump users into one of 2 separate groups upon signup dependent on username matching/not matching on spreadsheet or sql database.

Between the native discourse capibilities to interrupt user account verification so admin can confirm account, and sql code capibilities to auto award badges based on database criteria, there’s gotta be a way to write something to do this.

We need some serious guru powers here.
@sam @codinghorror

1 Like

You’ll need a custom plugin and /or some external scripts.

You should post in the #marketplace with budget for what you think “serious guru powers are worth”.

Never mind then… we thought this was a community forum not a business…

Where we come from, community members put in hours of work and fight over the opportunity to help a fellow community member… free of charge.

Our spin off forum is a prime example of this, it’s a community setup to support an incredibly sophisticated piece of software, created for home automation. The developer has spent months programming but keeps it freeware as part of the strong community spirit fostered by SmartThings.

Me posting on here is part of that spirit, doing my part for our community… we are not funded, but run by volunteers.

We are not looking for someone to do it all for us, but some code snippets, general guidance on the API etc would have been nice… instead we just get our posts closed, abrupt answers and sent to the #marketplace… this place has issues!!

It is a community,and you’ve gotten several recommendations for some ways to solve your problem. When what is needed is just a push or something that will help lots of users the feature may be added, but what you need is fairly specific to your case. The plugin that you describe is fairly complex and what is needed is a few days of a programmer’s time, not just a clever idea or insight into how discourse works.

And while the software is free, several here in this community make a living producing and supporting it.

I think that your best cheapest solution is an API call to set the group membership You can almost do it from the spreadsheet itself, but I think that the call you need to make is a post and that all you can get the spreadsheet to do is a get.