MyBB Community Forums

Full Version: Is it possible to re-use deleted FID's, UID's, etc?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, is it possible to re-use all of the deleted FID's, UID's, etc?

Because when I had my forum in it's early stages, I didn't turn off registration while I was working on it, and I got many spam bots, and now I have thousands of UID's that are now wasted, even though all the spam members are now deleted.

Is it possible?
they are all auto-incremented MySQL IDs that are used all over the database... if they have to be reset, it involves modifying a whole lot of rows and tables in the db.. i dont think its feasible and advisable to reset it...
You don't want to do this because it will cause problems down the road. You'd hit a collision if you altered the auto increment value to a lower number. This would mean no one could register or post until that gets fixed.
Would it still be possible to manually change the ID's to a lower amount?

Then once I have changed all the ID's manually to fill up all the 'wasted' ID integer numbers, to start the Auto Increment value to be after the last registered user?
It'd be possible, but one thing to note is that a lot of database relationships are used to prevent duplicated data from being stored, so FIDs, user IDs, etc. will be referenced in a number of tables. You'd have to be certain that all of these references were adjusted to prevent data integrity issues.
Would it be possible to do a search and replace SQL query in PHPMyAdmin, to replace the UID from 'X' to 'X' in all tables?

I only just started learning PHP & MySQL a week ago, so I am brand new to this.
(2014-11-04, 05:29 AM)Greg Winston Wrote: [ -> ]Would it be possible to do a search and replace SQL query in PHPMyAdmin, to replace the UID from 'X' to 'X' in all tables?

I only just started learning PHP & MySQL a week ago, so I am brand new to this.

Yes, like
UPDATE mybb_users SET uid = 6 WHERE uid = 32;

But you'll have to update a lot of things as many things depend on uid, tid, pid, fid.
So you basically have to update posts, threads, forums (lastposter) and some more stuff.
(2014-11-04, 12:13 PM)Rakes Wrote: [ -> ]
(2014-11-04, 05:29 AM)Greg Winston Wrote: [ -> ]Would it be possible to do a search and replace SQL query in PHPMyAdmin, to replace the UID from 'X' to 'X' in all tables?

I only just started learning PHP & MySQL a week ago, so I am brand new to this.

Yes, like

UPDATE mybb_users SET uid = 6 WHERE uid = 32;

But you'll have to update a lot of things as many things depend on uid, tid, pid, fid.
So you basically have to update posts, threads, forums (lastposter) and some more stuff.

Would you happen to know how I would update posts, threads, forums (lastposter) and some more stuff?