Page 1 of 1

Resetting database defaults

Posted: Fri Aug 07, 2009 6:10 am
by TrZ
I have installed a lot of mods during the lifespan of my forum. Most of the mods, I no longer use, some I can't even remember what they are.
My question is, is there a way to drop all the extra tables and columns in the database while preserving the data of the default tables?

I guess I can manually check each table against a vanilla install phpbb3 db, but that is a rather tedious task. Is there a script or update file that I can run to just retain the default tables?


Re: Resetting database defaults

Posted: Fri Aug 07, 2009 6:41 am
by AdamR
Having extra tables unused really should not effect performance of your board. To remove all MODs:
  • Be sure you have a backup of your phpBB Files and database (ACP > Maintenance > Backup > Choose to download the file). If you are unable to get into the Admin Panel, see the "Database Backup" section of this article
  • Delete all of your phpBB files except config.php, images/, files/, and styles/
  • Upload a fresh copy of the phpBB 3.0.5 files except config.php, images/, and files/
  • Point your browser to install/database_update.php. If it completes successfully, delete the install/ folder.
  • Before viewing the board again, ensure that there is nothing but index.htm and .htaccess in the cache/ folder.
You may also want to grab the latest version of your style and upload that to ensure you have any and all changes in 3.0.5.

- Adam

Re: Resetting database defaults

Posted: Fri Aug 07, 2009 7:15 am
by Tripp
Doesn't running the update_database script just update it, I don't think it deletes MOD tables and stuff but I could be wrong.

But the Support Toolkit can do just what you want:

Re: Resetting database defaults

Posted: Fri Aug 07, 2009 3:35 pm
by TrZ
Well Adam as Drugs said, that doesn't remove the extra tables and columns. Just updates the current tables format.

And Drugs, I tried it on a test board, my db doesn't have the default prefix which is phpbb_ it has phpbb_sitename_ which gives the toolkit the impression that all the tables with that prefix shouldn't be there, so it flags them for removal. And it tries to create new tables with the default prefixes, which most likely will be empty afterward.
Do I have to manually go and change the table prefix on each table? Or is there n easier way?

Re: Resetting database defaults

Posted: Fri Aug 07, 2009 3:48 pm
by stevemaury
The easiest way is to do what AdamR says and ignore the db changes, since they will be ignored by the php files.

I have reported as a bug your observation about the workings of the STK.

Re: Resetting database defaults

Posted: Fri Aug 07, 2009 4:17 pm
by TrZ
Well steve, the reason I want to remove the excess tables is because the database is larger than it should be, only 6900 members and over 229MB, whereas on other forums that I'm also admin, they have over 10k members and their database is smaller in size :| .

Plus I have a lingering automod installation there which for one reason or the other messed up during a server move or sumthin and now i can't uninstall it or upgrade it. I tried deleting the mods table but it just won't go away.

So those are the reasons why I wanna reset the db defaults.

Thanks for the help so far.

Re: Resetting database defaults

Posted: Fri Aug 07, 2009 4:41 pm
by AdamR
Users nor MOD tables will make up the majority of the size of the DB. For example, I have a populated test board with 10,000 dummy users. The user table is around 6MB in size. The mass information in the database will be occupied by the _posts and the 3 _search tables, all of which are several hundred MB. ;) There also may be lingering overhead on active and large tables, which can be recovered by optimizing the tables. This all depends on each individual board. I highly doubt cleaning up the MODs from the database will reduce the size of the DB to any significant amount.

At this moment in time, the STK is still in the testing stages and should not be used on a production board. Because of this, there is no "official" way to clean out the database of all non-vanilla tables and fields.

However, as has been said, deleting/replacing the files as was explained in my post above will remove any/all traces of the MODs from the files, and the tables in the DB will never be touched again. If you still want to remove the tables at a future time, the STK is working to be released as soon as possible. :)

- Adam

Re: Resetting database defaults

Posted: Fri Aug 07, 2009 5:08 pm
by TrZ
Okay, well I guess I need to rename the tables manually then try the stk again.

thanks for all the help guys :ugeek: