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 field_data_comment 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:

mysqldump <freshdb> --no-data --skip-add-drop-table > fix-mysql.sql

and apply the script to your broken installation:

mysql --database=<brokendb> < fix-mysql.sql --force

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.