MyBB Community Forums

Full Version: Duplicate table prefix warning
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've noticed this a few times... people make a new installation in the same database and use the same prefix, or reinstall when it isn't necessary, and because they don't realise that doing this will erase the current tables and replace them with new ones, they lose their data. I'd imagine 99% of people don't change the table prefix whenever they install, so their original forum has mybb_, and then when they install again, the prefix is mybb_ again, and the lose their data. Why not put in a warning, saying that the prefix is already in use and make it very clear that continuing with that prefix will erase their current forum. Some other forum installers have that, and I wouldn't have thought it would be that big an addition, but it may prevent at least some people overwriting their database without realising. It could either disallow it completely, and force you to drop the current tables if you really want to use that prefix, or just have a message to make sure you know what you're about to do.

Thoughts??
This would be a good feature. It would save people a lot of problems when installing another forum on the same DB.
(2009-04-02, 08:49 PM)MattRogowski Wrote: [ -> ]It could either disallow it completely, and force you to drop the current tables if you really want to use that prefix, or just have a message to make sure you know what you're about to do.

Just to expand on this, it could either say:

'Tables with this prefix already exist, continuing will overwrite them with empty tables. Are you sure you want to continue??'

or

'The table prefix you specified is already in use. Drop the existing tables with this prefix to use it, or specify a new prefix.'

Depending on whether you'd want to completely disallow it or not.
Personally i think the installer should disallow it because some people are just going to click OK without reading the Warnings.
Switch the cancel and the ok button and make the text as short as possible.
And if people still manage todo this, we've made the best effort of preventing it atleast.
Side thought: If the user overwrites the existing tables, make a backup in the ACP of the new install just in case.

But yeah, it's a good idea.
I definitely think this is a good idea, as like you said, most users do it without realizing their data will be lost.