Forums

Batch Loading of User Data

kkurtz 15 Sep, 2017
I need some advice and the best way to approach the following

I am going to need to load my Joomla user table with hundreds of users. I want to avoid having to enter them manually and would like to load the table from and Excel file. I know I can upload an Excel file into a Joomla table. But I can't seem to read that table and write to the user table and get the password encrypted. I know I have to use the Save User function but can't seem to get the Loop function to work.

Am I taking the right approach or is there a better way? If this is the right approach please give me some pointers on the loop function.

Thanks,
kkurtz
GreyHead 16 Sep, 2017
Hi kkurtz,

As this is a one-off task I'd suggest using some custom PHP to do it - you could add this to a form as a convenient way of wrapping the PHP.

Export the data from Excel to a CSV file and load that on to your site - or use the MySQL Excel plug-in to add it to a new table. Then have the custom PHP read a line, explode it into an array and use the Joomla! User Class code to add a new user from the data.

You could possibly use the ChronoForms Save User action but as you see there is no easy way to loop that through an array of user records.

I recommend that when doing this you test carefully with a few records before running through the hundreds.

Bob
This topic is locked and no more replies can be posted.