You are here

So you broke Drupal's tables...

If you have missing tables, you know there isn't an easy way to tell drupal or a module to recreate those tables. For example, this site was missing the [geshifilter-code]field_data_comment[/geshifilter-code] table, or something like that.

To fix it, create a new Drupal installation and install all of the modules that have tables that need repairing.

Now, dump all of the table definitions from the fresh installation:

[geshifilter-mysql]mysqldump <freshdb> --no-data --skip-add-drop-table > fix-mysql.sql[/geshifilter-mysql]

and apply the script to your broken installation:

[geshifilter-mysql]mysql --database=<brokendb> < fix-mysql.sql --force[/geshifilter-mysql]

Ignore all the error messages. Those that the existing tables that we don't want recreated.

Tags: 

Comments

Comments are working again!

Pages

Add new comment

Simple Copyright Policy: If you want to reproduce anything on this site, get my permission first.