MyBB Community Forums

Full Version: Restart Forum IDs from 1
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

Using Centos 7 on a VPS with MyBB 1.84.

My site is in development and due to go live in April.  One of my last jobs was to go through all forum permissions as I had previously added several user groups and changed the default registered group to limited permissions.

While manually creating sitemap.xml I noticed the search-friendly forum numbers are all over the place. I realized the forum IDs are not in any sort of order due to me adding and deleting forums.  Would this affect SEO?

I tried to kill two birds with one stone ie Reset my forum IDs and create group permissions at the same time. I deleted all my forums (over 100) with the intention of re-creating the category/forums and setting all the correct permissions in the first category and then using the copy forum function.  I optimized the database then created the first category and the ID was 193 not 1.

After searching on-line I found this MyBB post which stated to uses the following command.

UPDATE `forums` SET `fid` = '1' WHERE `fid` =193;

I thought this would reset the first category to ID 1 then all following categories/forums would auto-increment.

When using the sql command I received the following message -

Failed to execute SQL : SQL UPDATE forums SET fid = '1' WHERE fid =193; failed : Table 'table name.forums' doesn't exist

A look in the tables shows my-prefix_forums not forums so ran the mysql command
[code]UPDATE `myprefix_forums` SET `fid` = '1' WHERE `fid` =193;
[/code]

The command ran but with no output.  When I tried to access the category it had disappeared from my website although it remains in the admin panel. I have now deleted it from the admin menu.

I have a snapshot before I started and also a snapshot with all my forums untouched so I can restore.  As I currently have no categories or forums is there a sql command I can run to reset the forum IDs back to starting at ID 1?

Thanks for any help.

Philip
> Would this affect SEO?

Assuming you implement SEO correctly it shouldn't matter. I wouldn't even bother to reset the counter.
If you change a forum id, you also have to change all references to that forum id (in threads posts permissions whatnot) and also rebuild caches (such as the forum permission cache). It's not something you can solve with a single query.

SEO-wise, URLs would change (if you have IDs in your URLs, which is the case unless you're using Google SEO), so search engines would have to re-crawl. Although that shouldn't matter much for the forum list itself, since the main content in is in the threads.
Thanks for your replies. I will just restore my snapshot with all my forums and just reset permissions.