MikeNolan is looking to populate a custom user data field for around 2000 users migrated from phpbb3, containing a unique member ID for each user. Canapin suggests using a Rails script to fill in the field and ensure uniqueness, but notes that this is not possible for Discourse-hosted sites without access to the Rails console. Alternatively, MikeNolan could use the API to populate the field. While a one-to-one relationship between Discourse usernames and member IDs is not necessary, MikeNolan can use the Data Explorer tool to check for uniqueness once the field is populated. The task has been passed along to the primary contact for the Discourse group, who is handling the data migration MikeNolan.
On our DIscourse-hosted site we have a custom user data field for a user’s member ID in our organization.
What’s the easiest way to populate it for around 2000 users brought over from our old phpbb3 system? (I can generate a list of what username is what member ID.)
And is there any way to ensure that the contents of that field (when non- null) is unique?
Hi Mike
If I understand well, you created a custom user field that is currently empty and wants to fill it in for each existing user based on data you have somewhere.
I’ll do that with a rail script, and I’ll check the content is unique inside the script.
Since it was migrated from phpBB, do you have any reason to believe phpBB users’ IDs wouldn’t be unique?
If you’re Discourse-hosted, I’d ask directly to team@discourse.org as you don’t have access to the rails console; maybe experts will have better solutions.
I’m not the project leader on this (officially, I retired in 2016, I’m just helping with the discussion forums migration because of my long experience with it), I’ll ask him if we can have that done as part of the data migration. Otherwise, I could probably do it via the API.
A one-to-one relationship between Discourse usernames and member IDs isn’t an absolute necessity, I was just wondering if there was a way to enforce one. I can use the data explorer tool to look for non-uniqueness once the field is populated.