Hello,

I am building a new Drupal website who will need 1000+ users.
I have a list of users I need to create in a CSV file and I want to add them directly into the Drupal database instead of creating each one of them manually.

I added the informations into the "users" database and it works well, the users are present into the system.
But there is still one little problem : when users automaticly generated log in, they get to a 404 error.

Anyone would know where to add some info for it to work properly ?

Thank you for your help.
Matthieu.

Comments

yelvington’s picture

http://drupal.org/project/user_import

Directly manipulating the database is almost always a bad idea.

Matthieu’s picture

Thanks for the link.
This module would indeed do the job if I had a simple user import to do.

But what I'm actually doing is a bit more complex with the import of content as well.
I need those new user to be set as the creator and owner of an associated content imported at the same time.
I know it's not really a good idea to input directly data in the database, but I don't see any other solution to import in the system this kind of complex data architecture (exapt manually).

I looked into the user_import.module but it didn't give me much information on how it does the import ...
There is no Insert in the users table for example ...

Matthieu.

bestknight’s picture

Why don't you do a 2-step import. First import the users as above, then import the nodes using node import

Matthieu’s picture

I didn't know about this module, it looks pretty handy.
I didn't know i could map a CCK content with a module, I thought it would only be for common content (such as events).
Good to know.

I have one last problem with that :
How do I set up the ownership of a certain node to a certain user ?
I don't actually have a list of users, i just need to generate one per node imported with the ownership correctly set up.

If I can do that in a way or another, I'll definitly forget about my script ...
Thanks for your help.

bestknight’s picture

I believe 'uid' (user ID) or 'name' (either the one or the other) is compulsory. This field(s) define(s) ownership. I don't have a Drupal5 installation handy to test this. Just install the module at a test installation and try it out.

Matthieu’s picture

I have the modules installed, It should be fine indeed.
I'll try that out and let you know how it went.

Thanks for your help anyway !

yelvington’s picture

I looked into the user_import.module but it didn't give me much information on how it does the import ...
There is no Insert in the users table for example ...

That's because, as I said, it's a bad idea to muck about with tables.

Use the API.

http://api.drupal.org/api/function/user_save/6