MyBB Community Forums

Full Version: Changing all table names to default
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
is there a simple way for a beginner to make database tables the default name they usually have? ( my are not default )
i want to fix the problem once and for all so that when i make a clone of the forums for testing purposes it won't make me problems.

i know i can configure it to accept the other tables names but i find it complicated for some reason.

what is it involves for changing the names?

LV!
I guess you want to change the table prefix (for example: "mybb_"TABLENAME or in your case "anything_"TABLENAME)?
There is absolutely no need to rename the prefix of tables in terms of compatibility or troubles.
Even the 'usual' prefix "mybb_" is an individual string added to the table name. You can leave that at all, as long as 'TABLENAME' is kept to be original, because this is what forum system boots on. The prefix is just a gimmick Smile
Technically it makes no sense to rename tables names just for "eye candy" or a "usual" purpose. A computer does not care any table name; and any prefix can be set in ACP Wink

Nevertheless it is no big deal to rename a table.
You need have access to a database administration tool to run SQL. There are different ways.
The following SQL is for MySQL (but also other database systems have similar statements):

1.
RENAME TABLE
yours_posts TO mybb_posts,
yours_threads TO mybb_threads,
yours_templates TO mybb_templates,
...;

2.
ALTER TABLE yours_posts RENAME mybb_posts;
ALTER TABLE yours_threads RENAME mybb_threads;
ALTER TABLE yours_templates RENAME mybb_templates;
...;

Make sure the forum is deactivated for the time of change.
Set the new table prefix in ./inc/config.php.

[ExiTuS]

PS.
Just fount another great solution. See:
https://community.mybb.com/thread-190001...pid1212954
yes, thanks i will check it later....
yes,

i want to rename it so i can easily make a backup copy of the forums at my host and check the backups from time to time, there. i mean verifying the the backup files are ok.

i will need to first figure out the current table name. is that shown in the admin panel?

where exactly do i type the commands in the mysql interface?

i will make sure to deactivate the forums..

i will try to see what's in the link....
EDIT.. so what in the link is actually a shortcut?
would appreciate an assistance.
where do i find the current table name?
and where exactly to type the commands?

and also
how do i change the language of phpmyadmin?
it's jumbled in hebrew

edit
so i've found how to write queries. but i don't know the answer to the other questions

i also need to know which of the queries that you suggested is better to use in my case.
i will backup the board before doing things.
phpMyAdmin / Select All Tables / With Selected: / Replace table prefix
i will try soon

Quote:1.
RENAME TABLE
yours_posts TO mybb_posts,
yours_threads TO mybb_threads,
yours_templates TO mybb_templates,
...;
i did it. this is the results.... error....

perhaps i did something wrong?
[attachment=45123]


other than that. i did what HLFadmin said earlier but my whole site collapsed with an error.... [if you want a screenshot of the error let me know]

i'm wondering what i did wrong.

at the moment my forums content isn't available.. i will need to find a way to restore my backup again..
Can we just go over again why you need to be doing this?

The table prefix doesn't matter - whether it is mybb_ or something else, it simply needs to be defined in the inc/config.php file. I think we're going through a needlessly complex, and potentially destructive, process for no real benefit.
hi
i will explain again......
i need the change because i want to easily create a copy and then i will be able to check the backup files in that copy.

now i understand that i can change the prefix in the config file..... forgot that you suggested it before..

but still i want it to be neat and as default....

if i will send a copy of the database to someone to fix the prefix is that a good idea? or perhaps the backup database file contains passwords?

if you can't assist it's ok. i will just change the config file again after i will reestablish everything.
i didn't remembered the option so i just tried to follow the queries suggested (it wasn't a very good idea as i now have to setup once more....)

BTW
in the process i'm getting used to all these tools so i'm learning something too..

have a cool day all!

one more thing

what is the best option here when it comes to auto updates/upgrades?
[attachment=45124]
Honestly, I just really don't think this process needs to be done. The table prefix literally doesn't matter, you don't even need to have one at all if you don't want to. If you ever want to restore a backup to test it, the config file simply needs to be set to use the required table prefix. This is the whole reason it is configurable in the first place. My concern is that we're messing around with database tables, doing something that could mean you lose data, for something that literally doesn't matter to anything.

Also, I suppose you'd want automatic upgrades to minor versions, but you'd need to ask your host how that process works in terms of backing up the database before running the upgrade script. This is a service they offer so we don't know how the upgrades are actually applied.
Pages: 1 2