A user, Timelord, seeks help importing users via CSV in Discourse, encountering errors when using the CLI script. supermathie clarifies that the script is for migration, not simple user import. pfaffman explains the script expects multiple CSV files (users, emails, custom fields), and the error arises because required files like emails.csv are missing. Timelord confirms the script is attempting to load users.csv but fails due to missing dependencies. pfaffman advises ensuring the file is in the correct location or setting the CSV_USER_FILE environment variable, and to comment out unused CSV imports. supermathie suggests disabling emails during import to avoid sending notifications. Timelord confirms users.csv should include email addresses, and pfaffman confirms this. The discussion highlights the complexity of the import script and the need for file structure and code adjustments.
I know there is a ‘frontend’ way to invite users via CSV, however that will not work in my case, as it will send an email to the thousands of people who will be added to the site.
When trying to add it via the CLI, I get the following errors.
I have next to no programming skills. I assumed it would be as simple as kicking off the import.rb file ‘pointed’ at the users.csv.
The errors it output make exactly zero sense to me. I looked at line 29 of the import script and it referenced headers, so I assumed it meant the columns of the csv file, so I spent some time mucking with that, to no avail.
Well, you didn’t get very far since it never even opened your csv.
It’s one of those frustrating things where it could take 30 seconds or hours.
But you might try copying the file to there. It’s tricky because it’s one place in the file system of the computer and another inside the container. Once you solve that you can start mucking with the column headings.
So either put the file there, or set ENV variable CSV_USER_FILE to wherever you put the file.
Oh, but the first thing the script does is read in ALL of the CSVs it expects (all of those @… = load_csv lines), so you’ll need to comment out or delete the ones you don’t want. And the import_users looks at custom field data, so you need to change that too.
If that’s not enough of a hint, and you’ve got a budget, email (in my profile) me a number and I’ll see what I can find a way to help you for that number.