Recent migration to discourse caused usernames to change!

I recently moved a site to Discourse. what i didn’t realise was many users usernames got changed and the new usernames seem to use a part of their email address. I have never seen usernames change during previous migrations. how can i revert this?

If you’ve gone live then it’ll be difficult to change things, though the original username should be in a user custom field. You really want to solve these problems in the testing phase.

Unless the migration script is broken, the reason that usernames are changed is that they are incompatible with the discourse username format.

What are some usernames that were changed? What did you migrate from?

4 Likes

Thank you for your reply Jay. We had to put the site on maintenance mode to make these corrections. it was weird that the username and name columns were changed. we are seeing how we can swap them. this is very confusing…

You can look at UserCustomField.where(user_id: some_id) to see what custom fields exist for that user, which should include their original username.

1 Like

We were able to swap. But after swapping the profiles won’t open! It’s says oops page not found.

Just to double check, you refreshed your page after remapping usernames, right? Discourse will still use old name client-side until you reload, so if you remapped names and didn’t reload, it’d try to open user profiles that no longer exist.

Thank you. We will check for that.
Also, I don’t understand how it decides to automatically assign first half of the email address.