Forums | Mahara Community

Support /
CSV upload of institution members


anonymous profile picture
Account deleted
Posts: 20

10 August 2010, 10:08

Dear all,

we are planning to create a Mahara institution for each school at the University of Vienna and upload the users via the CSV upload mechanism in order to put them in the correct institution.

However, I've got a CSV file with >10000 user entries and it seems Mahara cannot cope with it. It creates only 337 users and then stops.

My question: is there a better way to put the users in the schools? Maybe I could just write directly into the database. However, what would I have to take into account to get a consistent database?

 

Thanks in advance

 cheers

   Juergen

anonymous profile picture
Account deleted
Posts: 808

10 August 2010, 17:47

The CSV user creation is especially slow when adding users to institutions (possibly this is because of the new member notifications that get sent).  We will eventually try to speed this up, but there some things you could try now.

One is just to raise the memory limit and script timeout.  If you grep through the code for the php set_time_limit and raise_memory_limit functions you can find a couple of places where this is already done.  If you add these function calls with sensible values at the top of htdocs/admin/users/uploadcsv.php you should be able to upload more than 337 in one go, but you will probably still want to split up your 10000-user file.

Another workaround that might help is to create the users in 'No institution' (quite a bit faster) and then put them into the correct institution afterwards.  Unfortunately I don't think the institution members page lets you forcibly add users to institutions in bulk, you might only be able to send invites there.

But if you have users in No Institution, and you want to add them to an institution and keep the db consistent, just create records in the usr_institution table with the appropriate user and institution ids.

anonymous profile picture
Account deleted
Posts: 20

13 August 2010, 4:26

Dear Richard,

thanks for your reply.

I fear, I cannot upload them to no institutution because I have a large number of users and I couldn't figure out afterwards which users to put in which institution. So I have to manipulate the DB directly.
I tried creating entries in  the tables 'usr' and 'usr_institution' but that does not seem to be enough because I can neither find users with the user search nor can I log in as one of the users...

What else do I have to put into the DB to have valid users?

Thanks

   Juergen

anonymous profile picture
Account deleted
Posts: 808

15 August 2010, 19:42

I don't remember 100%, but they do need entries in other tables, that's why I suggested uploading them to No Institution first.

I know some of the profile fields from the usr table (firstname, lastname, email) are copied into the artefact table, and the email address is copied into both artefact *and* artefact_internal_profile_email.  Don't ask me why there are 3 copies of it.

They also get a default blog created in the artefact table, but hopefully you can get away without that in 1.2.

There are also default entries created in usr_account_preference and usr_activity_preference, but if you can get to the settings and notifications pages okay, then they're hopefully unnecessary.

4 results