[Typo3] Clean up unused data in database
Dirk
typo3user at gmx.net
Sat Nov 19 00:29:03 CET 2005
Hello list,
>> Another question: how to get rid of tables created by extensions that are no longer active?
>
>Hi Dirk,
>
>When you do a compare in the install tool under 'Database Analyser' you
>can find tables that you can drop of no longer active extensions.
Okay, I've done this:
- opened Install Tool from the BE
- "2: Database Analyser"
- "Update required tables COMPARE"
- selected all checkboxes
- "Write to database"
Now, when I view the FE-page I get this as the first line of the page:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in ***\htdocs\***\t3lib\class.t3lib_db.php on line 741
Tools>DB Check:Record Statistics gives me this:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in ***\htdocs\***\typo3\t3lib\class.t3lib_db.php on line 741
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in ***\htdocs\***\typo3\t3lib\class.t3lib_db.php on line 754
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in ***\htdocs\***\typo3\t3lib\class.t3lib_db.php on line 754
I re-tested it after a rollback (always have one at hand ;) giving me the same results; a second TYPO3 installation behaves exactly the same after DB comparing it so it's not a one time issue.
Seems like the database compare broke something.
* After re-renaming the table "zzz_deleted_static_taxes" to "static_taxes" the Tools>DB Check:Record Statistics calmed down.
The FE error message remained even after giving all tables their names back. (-> two separate bugs/glitches; the FE-bug having to do with removed fields)
While searching for the missing field I recognized fields I think whould have not been removed by the DB compare:
ALTER TABLE pages DROP zzz_deleted_tx_templavoila_ds;
ALTER TABLE pages DROP zzz_deleted_tx_templavoila_to;
ALTER TABLE pages DROP zzz_deleted_tx_templavoila_next_ds;
ALTER TABLE pages DROP zzz_deleted_tx_templavoila_next_to;
ALTER TABLE pages DROP zzz_deleted_tx_templavoila_flex;
ALTER TABLE tt_content DROP zzz_deleted_tx_templavoila_ds;
ALTER TABLE tt_content DROP zzz_deleted_tx_templavoila_to;
ALTER TABLE tt_content DROP zzz_deleted_tx_templavoila_flex;
ALTER TABLE tt_content DROP zzz_deleted_tx_templavoila_pito;
Are these *REALLY* save to remove? I doubt it...
Nevertheless after rerenaming these the FE error is still there, so they're not responsible.
* Reverting the name of the table "static_languages"'s field "zzz_deleted_lg_country_iso_2" to "lg_country_iso_2" the FE message went away. *_3 and others could remain zzz_deleted_'d, maybe this is a codepage specific behaviour.
Assuming that it's common use to run "DB compare" to clean up the project and experiencing the CATASTROPIC effect that has on the website and stability of TYPO3 overall I just want do say:
-- D O N T D O I T ! ! ! --
(or do it on tables and field you are SURE they ONLY and CLEARLY belong to an extension you dumped some time ago)
Have a nice evening,
I hope the above report can help you or someone who's feeling responsible...
Dirk
More information about the TYPO3-english
mailing list