• 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

DBA

Well-known member
#1
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)
 

CTXMedia

Formerly CyclingTribe
#2
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)
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)
 

CTXMedia

Formerly CyclingTribe
#5
UserID 3 doesn't exist anymore, it's skipped in the database, goes from 2 to 4.
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! ;) ]
 

DBA

Well-known member
#7
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! ;) ]
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?
 

CTXMedia

Formerly CyclingTribe
#8
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?
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.