We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18082
    • 8 Posts
    Hi,
    I am trying to import a csv list of users + extended attributes into modx.
    I have created a table in mysql with all the required columns, including internalKey. My id column is called SiteNo.
    I have imported the entire csv list into this - however I’ve made internalKey Not Null. But it is set as MUL.

    Now How can I either:
    a). Use the current imported csv and allow new users to be added using the manual register form (linking to the extended attributes table) and display the list without needing to link to the webusers at all.
    b). Split the csv to take some data for the web users attributes table, rest to the extended attributes and create the joins/links in the web users table.
    c). Oh and to not save default image to the web user attributes if entered manually as there is no need for photos ever.

    There are 250 users to be imported, I really don’t want to do them all individually! smiley

    Hopefully I have explained it clearly?

    Thanks

      • 29181
      • 480 Posts
      I had to do something similar recently, importing a little over 2500 users into MODx.

      I split the CSV data into 3 different lots so I could import it using PHPmyAdmin into the web_users, web_user_attributes and my custom WebloginPE table.

      The thing that made things easier with my import was that usernames were being created automatically as opposed to the user being able to create them.

      To how to do it...

      I exported the tables you mentioned, took the data I required from the original data, added id and internalKey and simply inserted everything. This took about 30 minutes using Excel, I backed up the 3 tables (as I expected something to go wrong) and it actually worked.

      To add a password, I simply created a hashed password and inserted it into the table.

      I hope that helps a little.

      Taff
        Adrian Lawley: www.adrianlawley.com