The discussion revolves around importing users into Discourse using a CSV script and concerns about user ID conflicts. Isambard raises the issue of potential clashes between imported users and existing users, noting that the database uses a sequence for user IDs (nextval('users_id_seq'::regclass)), and wonders if a high prefix is needed to avoid duplicates. pfaffman reassures that imported users are assigned new Discourse IDs, so conflicts with organic signups are not a concern. Isambard expresses concern about the import script potentially bypassing the sequence, but pfaffman clarifies that the CSV IDs are stored in a custom field and do not affect the actual Discourse user ID, ensuring no conflicts occur.
In the importation scripts (at least the CSV one), I see that there is an option to add a prefix to the user id - presumably to avoid clashing with existing user ids.
Let’s say I have current 500 users on discourse and I want to import 1000 users via the CSV script. Let’s say I use a prefix of ‘1’ for the import script so the new users have userid 1000 to 2000.
What happens when the organic signups hit userid 1000? Would this create any issue or would the software automatically add the new user to id 2001?
I’m trying to work out if I need to put a very high prefix to avoid this issue.
It doesn’t matter. It’s s problem only if you import from multiple sources and they clash. They be assigned a new Discourse user id, so that’s not a problem.
The imported users are assigned new Discourse ids. The ids in your csv are saved in a user custom field, but have nothing to do with the discourse user_id.