CSV user import

 

 

This plugin allows administrators to create user accounts in bulk based on information stored in a CSV file

Requirements

The format of the CSV is important and must be created according to set rules:

  • The CSV must have a header row
  • The CSV file must be encoded in UTF-8 format and without BOM
  • The CSV should have text cells quoted in case they contain commas or other special characters
  • Make sure the header names match the columns exactly
  • The required column headers are:-
    • username
    • email
  • The optional columns are:--
    • password
    • fullname
    • account_expires
    • comments
    • ip_restrict
    • lang - the language set for the user will default back to the one set using "$defaultlanguage" config option if the lang column is not found or doesn't have a value

For more information on the fields available please refer to Creating users

Passwords

Please note: If either no password is given to specific users in the CSV or the CSV does not contain a password column, a password will be generated for those users followed by a password reset email sent out to the provided corresponding email address. This will allow users to then set up their own password and is a fast way of setting up users. Any passwords provided will be validated against your password validation settings. If any password fails, the CSV process will be stopped and you will be informed where the errors exist in the log.

Importing the users

Please note: as is recommended when making any significant change to the system, please ensure that you have an up to date backup of the ResourceSpace database and filestore before proceeding.

The plugin adds a 'Batch user import' field to the Manage users page. To create the user accounts

  1. Enable the plugin 'csv_user-import'
  2. Navigate to Admin > System > Manage users
  3. Click on the 'Import' link
  4. Click on the 'Choose file' button
  5. Select the CSV file containing the user information
  6. Select the target user group in which the users will be created
  7. Click on 'Next'
  8. Review the report for any errors. If all is ok you should see a message stating 'Info: data successfully validated!'
  9. If there are errors reported, correct them as necessary and restart the process
  10. Click on 'Process CSV'
  11. The box will display messages to confirm the accounts have been created e.g. 'Info: Created new user "cyrille.regis" with ID "37"'

Troubleshooting Tips

Error: Email <email address> exists already in ResourceSpace

This error means that the system has found an existing account with the same email address already in ResourceSpace. Either delete this row from the CSV, delete the user or change one of the email addresses in the system or in the CSV

Error: Could not find mandatory column ""

Self explanatory - the system has not found a required column in the CSV. Check that the spelling of the header column matches the required names above and there are no extra quotes or other punctuation marks present

Info: ResourceSpace has no use (ie. unknown) for column "" and as such it will not be taken into account

This error means that there is a column in the CSV that does not match any applicable user field. Any values in this column will be ignored