XF 2.1 How to change UID?

Status
Not open for further replies.

KateAwpton

Member
Hello! I was wondering how to change the uid of a new registered account. my user id is 4 but 2 and 3 are deleted accounts, how would i go about either restoring those accounts or creating a new account in their place?
 
Deleting all members and posts won't reset the increment.

It would require direct DB manipulation to re-use IDs and it's not something we would condone or be able to support.
I’ve seen it done before, if I permanently delete an account I should be able to use the uid again for another account, or at least restore the accounts... is any of this possible?
 
Make a fresh install and then never delete a user would solve it or try to live with gaps in the UID list.
For a new forum it should be a smaller problem than getting users and content.
 
No way I could specifically delete a user db or anything and just reinstall that?
A lot of things you could do. I think, if you have phpMyAdmin or something, you can delete all users except for 1. As it's auto-increment, the next member that joins should be 2. Or, rebuild the entire table from scratch (though, the UID's are linked elsewhere, such in posts... so you'd have to modify them too).

Then, just change the post content ownership when the new members join to match who posted what.

Otherwise, start from scratch.

It's a little OCD to be thinking that missing a UID is important unless you just want the top 25-100 to have a claim to being that user ID down the line. If you think UID is important, wait until you get into having 10+nodes and then finding out you need the 11th node, but in the 1st category so it goes node id 1, 2, 11 (you can remove node ID in the URL portion), but, the IDs are irrelevant IMO. You're going to have UID gaps, I believe when it comes to profiles when it comes to banned/unconfirmed/unregistered or something because I have X users, but UIDs are 35+ more than actual members and I never deleted any.

The easiest, and probably recommended way, would do a fresh install as you have so few members, and likely few posts too. Save all posts (if necessary) and then repost them under in admin in a private node, reassign them to the new accounts with an add on after they rejoin, then move them to the new forums created.
 
A lot of things you could do. I think, if you have phpMyAdmin or something, you can delete all users except for 1. As it's auto-increment, the next member that joins should be 2. Or, rebuild the entire table from scratch (though, the UID's are linked elsewhere, such in posts... so you'd have to modify them too).

Then, just change the post content ownership when the new members join to match who posted what.

Otherwise, start from scratch.

It's a little OCD to be thinking that missing a UID is important unless you just want the top 25-100 to have a claim to being that user ID down the line. If you think UID is important, wait until you get into having 10+nodes and then finding out you need the 11th node, but in the 1st category so it goes node id 1, 2, 11 (you can remove node ID in the URL portion), but, the IDs are irrelevant IMO. You're going to have UID gaps, I believe when it comes to profiles when it comes to banned/unconfirmed/unregistered or something because I have X users, but UIDs are 35+ more than actual members and I never deleted any.

The easiest, and probably recommended way, would do a fresh install as you have so few members, and likely few posts too. Save all posts (if necessary) and then repost them under in admin in a private node, reassign them to the new accounts with an add on after they rejoin, then move them to the new forums created.
what table are users stored in?
 
I have locked this thread as nothing good is going to come from this (based on the posts).

Either accept that there will be gaps in the IDs or reinstall XF.
 
Status
Not open for further replies.
Top Bottom