News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

changing board id numbers?

Started by pittu, December 08, 2010, 03:32:50 PM

Previous topic - Next topic

pittu

Hi,

How to change the boad ids?

Ex:
http://www.simplemachines.org/community/index.php?board=147.0

How to change '147' to my desired number?

Because I am deleting many sub forums and I want only few boards with sequencial serial numbers.

IceXaos

Most likely a simple # in your database, but let me look quick and I'll give you a location to check out.

IceXaos

Inside `smf_boards` column `id_board`.  Be careful you don't do any duplicates, and unsure of any affect this may have on how they add on from here.

pittu

This doesn't affect threads or any other thing? They will work properly?

IceXaos

Inside `smf_topics` column `id_board`, you will need to change all topics using that board to the new ID.  Just a simple PHP script or through phpMyAdmin.

pittu

Any other things I need to take care of?

IceXaos

Quote from: pittu on December 08, 2010, 05:13:04 PM
Any other things I need to take care of?
Not sure as I haven't actually looked into it.  I'm just lettin' you know how to do what you ask.

Hj Ahmad Rasyid Hj Ismail

Which is dangerous, IMHO. Backup your database first if you need to do something risky like that. One mistake in changing board id may cause your forum not properly shown. By the way, if there is nothing wrong with the board id, just leave it like that. It won't harm you but changing it with even a very tiny slight mistake will. It is called unique and will keep increasing even the old unused one has been deleted. If you still insist on doing it, is your call but do backup first.

IceXaos

Quote from: ahrasis on December 08, 2010, 05:46:35 PM
Which is dangerous, IMHO. Backup your database first if you need to do something risky like that. One mistake in changing board id may cause your forum not properly shown. By the way, if there is nothing wrong with the board id, just leave it like that. It won't harm you but changing it with even a very tiny slight mistake will. It is called unique and will keep increasing even the old unused one has been deleted. If you still insist on doing it, is your call but do backup first.
I guess I should have stated the idea of backing up.  It's just something I naturally do when trying anything out I'm unsure of, not something I think about.

Anyways .. good luck.

pittu

Quote from: ahrasis on December 08, 2010, 05:46:35 PM
It is called unique and will keep increasing even the old unused one has been deleted.

What do you mean by this?

Say I have 1,2,3,4,5,6 ids for 6 boards.

I delete 1,3,5 id boads and 2,4,6 becomes 1,2,3 (I can change it in mysql databae backup file and restore the db from it.)

If in future If I want to create a new forum, it gets 7 or 4 id?

thanks!

Masterd

Quote from: pittu on December 10, 2010, 11:55:53 AM
If in future If I want to create a new forum, it gets 7 or 4 id?

thanks!

It will be 7.

Kays

Hmm, bad idea... I would not recommend doing this.

The board ids are the index for that table. This is automatically incremented to the next value and is how the database keeps track of things. There's also the added complication that the board ids are used and logged elsewhere.

Don't do it. It's not worth the hassle.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods


pittu

Quote from: Masterd on December 10, 2010, 12:07:19 PM
Quote from: pittu on December 10, 2010, 11:55:53 AM
If in future If I want to create a new forum, it gets 7 or 4 id?

thanks!

It will be 7.

OK Guys. I hear you. Thanks all of you for your advice. I am not going to do this.

But this works? (last idea):

Import present database > update ids > create a new database > import data into it and connect to new database.

If I create a new forum in future, it gets 4 or 7 id?

Masterd

Quote from: pittu on December 10, 2010, 12:33:50 PM
If I create a new forum in future, it gets 4 or 7 id?

It will be 7.

Kays

Quote
Import present database > update ids > create a new database > import data into it and connect to new database.

Then you can also change the auto-increment number to 4. You'd still need to find where else the board ids are stored and change those also.

If this is a live board and it has been crawled by search engines. There will be the addition problem of pages not found or links to the wrong board if the boards were indexed.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

pittu

How to hide the boards from viewing on the index page? I set permissions for these boards so members won't see them. But when I login as admin > I am seeing all these boads cluttering my eyes. So how can I hide them for admin too?

Paul_Pauline

Admins get to see everything   :)
"In every life, no matter how full or empty one's purse, there is tragedy. It is the one promise life always fulfills.
Happiness is a gift and the trick is not to expect it, but to delight in it when it comes and to add to other people's store of it."
Pauline was one of those rare people who increased the store of happiness in the world.

Kays

Yep, :D

Put then together as child boards of the last board on board index..

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Advertisement: