1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Setting up a user programatically

Discussion in 'XenForo Development Discussions' started by SchmitzIT, Feb 1, 2012.

  1. SchmitzIT

    SchmitzIT Well-Known Member

    Would anyone know which tables are involved when a user is created? I am trying to import users through a third-party system (Microsoft SQL Server Integration Services), and while my import populates the xf_user table, when I try and check the user list in Admin CP, and can see the users there, clicking them gives an error message.

    I populated a few of the other tables as well (xf_user_profile, xf_user_custom_field and xf_useR_authenticate (I essentially created a user IN the system first, and then grabbed the generated hashed password from that, and recreated them for all users in the import), but somehow it seems like I still miss something.

    I'm trying to import from a non-mySQL database, and believe that if this can be pulled off, there would be a whole new range of non-mySQL forums that suddenly could get converted to XenForo, but the fact there's errors slightly concerns me.

    I have two users working now for some odd reason (I think it might be leftovers from manually created XenForo users, so obviously something is still stored somewhere. I just cannot figure out which table, and i checked the xf_user* tables).

    Thanks in advance :)

  2. ragtek

    ragtek Guest

    You SHOULD use the xenforo user datawriter for this!

    There are too many dependencies for an user.
    You could also check the user datawriter, to see the related tables;)
    SchmitzIT likes this.
  3. SchmitzIT

    SchmitzIT Well-Known Member

    Well, I would love to use the XenForo DataWriter if I could use that to connect to other database systems (Microsoft SQL in this case). I wanted to use SSIS since it's an easy way to move data across different database platforms (and I know how to use it already, unlike the XF datawriter stuff).

    I will try the privacy table, that's about the only one I might not have looked at yet, but I don't get why there is additional stuff going on under the hood everywhere. I had similar issues when trying to programatically add a custom user field; to avoid having to manually do all the work, I could whip up a quick query, but also there, just adding a field to the database table does not work.

    I wish it would be made easier to get stuff done, rather than having to rely on the DataWriters in order to perform something as simple as adding a record to one or more tables.
  4. Mike

    Mike XenForo Developer Staff Member

  5. SchmitzIT

    SchmitzIT Well-Known Member

    ragtek, that was my missing link. If you were anywhere near, I'd kiss you (no tongue, though).
    erich37 likes this.
  6. JaredNZ

    JaredNZ Member

    SchmitzIT likes this.
  7. SchmitzIT

    SchmitzIT Well-Known Member

    No, I didn't. I ended up being able to use SSIS anyway :) Had to use a third-party component to get it to work properly, though, and I'm still experiencing some odd issues here and there with it, but the conversion went well.

Share This Page