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

XF 1.1 Change UserID

Discussion in 'XenForo Questions and Support' started by DBA, Jun 19, 2012.

  1. DBA

    DBA Well-Known Member

    Is there an easy way to change a users userID in the database? For example change it from 10032 to 3?

    (userID 3 is currently empty as that user was deleted back in the vB days)
     
  2. CyclingTribe

    CyclingTribe Well-Known Member

    If both users have been registered but have no activity then I would expect it would be a fairly straight-forward swap of User ID.

    The difficulty will be if user 3 has previous activity recorded in other tables - it would then be a man-hunt for the records associated with either/both UID's and might not be worth the effort (or guarantee a "clean" finish). (y)
     
  3. DBA

    DBA Well-Known Member

    UserID 3 doesn't exist anymore, it's skipped in the database, goes from 2 to 4.
     
  4. Marocinoh

    Marocinoh Member

    In PhpMyAdmin, no?
     
  5. CyclingTribe

    CyclingTribe Well-Known Member

    Okay, well if user 10032 hasn't done anything I would expect you could change the ID to 3 and job done! (y)

    [I reserve the right to be completely wrong and would suggest checking with maybe Jake or one of the XF team - just to be on the safe side! ;) ]
     
  6. Marocinoh

    Marocinoh Member

    In your DB, modify 10032 with 3. If, does work, modify 3 with 10032.
     
  7. DBA

    DBA Well-Known Member

    Yeah that's what I assumed, however how many different locations is this at? So far I've found it in the xf_user and xf_user_authenticate tables, anywhere else that I should look for it?
     
  8. CyclingTribe

    CyclingTribe Well-Known Member

    TBH I think xf_user is the only one you'll need - presumably (I don't know for sure) the auth table will be for users who've registered but not yet confirmed their account.
     

Share This Page