Inserting users with SQL - usernode automatically created?
Blackguard - February 28, 2008 - 03:18
| Project: | Usernode |
| Version: | 5.x-1.3 |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
I am converting a site to Drupal. I set up usernode and nodeprofile, with template files.
I'm going to write a php/mysql routine to import a database with 15000 users, with a lot of conversion involved.
Will the usernodes be created automatically after inserting new users in the drupal database, or do I need to take care of that at the same time, i.e. creating a usernode at the same time I create the new user?
Or should I disable and uninstall usernode, import the users, and reinstall usernode?

#1
I am pretty sure if you use user_save() vs adding with SQL the usernode will be created. The way to check is look at the code for usernode and look for usernode_user() handling the 'iinsert' case.
#2
Thanks, that a very good start and got me along a bit of the way.
I included
include_once('includes/bootstrap.inc');drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
in my script and am now able to use user_save() on my processed user data - the usernode is created.
Now what is going to be complicated is inserting all the user data into the nodeprofile node. Any suggestions regarding that are very welcome.