MyBB Community Forums

Full Version: How can I change a forum ID number without breaking it?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Let's say I have a forum with fid 90

But I want it to be fid 95

What do I change in the database in order to make this change without it causing "invalid forum" to appear after?

When I go into the forums in the database and change fid from 90 to 95, it brings up the error.  Where else do I need to make the change?
AFAIK things such as threads are also used by the FID's, as well as other stuff, so it won't just be changing the ID of it, that pertains to basically everything, same thing with user ID's, you can't just willy nilly change ID's and expect things to work. You'll need to find everything that connects to FID and change that.
Correct, that's what I am asking for: what are all the other database tables that contain the fid field that would need to be changed? Or is there perhaps a mysql command line that would automatically find and replace all instances of that fid with the newly desired fid in just one shot? I'm willing to go through and do them one by one, by hand... or using a command line.
^ replies here might help
There is a lot that could potentially be linked to FIDs, including topics, announcements, etc. You'd have to go into the tables individually via phpmyadmin and look for the instances, and even then, it'd be multiple queries to correct all instances of the old FID. Integer IDs used as the primary key aren't really meant to be changed for a reason.

Why exactly do you need the FID changed?
(2014-08-26, 02:13 AM).m. Wrote: [ -> ]^ replies here might help

I wouldn't run any SQL query that is found in that topic, it's from 2011.
fid along other IDs are auto increment fields, mean MySQL takes care of incrementing that field whenever you create a new one.

Although, if you're starting fresh, or want to delete all the forums / categories and create new empty ones, try the following query on your MySQL (using PHPMyAdmin for example) :

Giving that your database prefix is mybb_ :

ALTER TABLE `mybb_forums` AUTO_INCREMENT = 1;

Don't run that if you already have forums and threads..!!
(2014-08-25, 11:51 PM)CheckingThis Wrote: [ -> ]Let's say I have a forum with fid 90

But I want it to be fid 95

What do I change in the database in order to make this change without it causing "invalid forum" to appear after?

When I go into the forums in the database and change fid from 90 to 95, it brings up the error.  Where else do I need to make the change?

MyBB uses a cache system to lessen the amount of queries. You have to rebuild the forum and forumpermission caches if you edit either the forum or forumpermissions table. This can be found in the ACP->Tools & Maintenance->Cache Manager.
Thank you guys for the help on this. I was able to get it figured out in preparation for a server switch that was mostly a success.

The only issue remaining that I see, as a result of the server switch, is what I mentioned in my other thread about an hour ago. For some reason, banned members are showing up twice in the Mod CP instead of just once. How do I fix the duplicates in the Mod CP banning area? Thanks again!
It might possibly be related to this issue: https://github.com/mybb/mybb/issues/266.
Pages: 1 2