1

Possible Duplicate:
How do I convert a database from MyISAM to InnoDB?

Due to a bug in the Backup and Migrate module http://drupal.org/node/1128620 , all of my DB tables were reverted to MyISAM. How to return them all back to to InnoDB. (Perhaps using phpmyadmin?)

I used to use http://drupal.org/project/dbtuner/ in D6 for this. However there isn't a D7 version.

Also, are there any side effects or possible gotchas for switching this in this way?

Update:

<?php
    // connect your database here first 
    // 
    $sql = "SHOW tables";
    $rs = mysql_query($sql);

    while($row = mysql_fetch_array($rs))
    {
        $tbl = $row[0];
        $sql = "ALTER TABLE $tbl  ENGINE=INNODB";
         mysql_query($sql);
    }
?>

What do I need to add to the section "connect your database here first" to connect to my Drupal DB?

3
  • See stackoverflow.com/questions/3856435/…
    – Clive
    Commented Jul 2, 2012 at 21:06
  • Any simple instructions for doing this in phpmyadmin? Commented Jul 2, 2012 at 21:10
  • THe following does not workSELECT CONCAT('ALTER TABLE ',table_schema,'.',table_name,' engine=InnoDB;') FROM information_schema.tables WHERE engine = 'MyISAM'; Commented Jul 2, 2012 at 21:30

1 Answer 1

3

The easiest way is to take a backup with Backup and Migrate, open it in an editor and search/replace "MyISAM" to "InnoDB". Then restore it.

Personally, I would restore to a new catalog, and then switch the database in settings.php. This way, you can test before making the new version live.

Otherwise, this is a dup of How do I convert a database from MyISAM to InnoDB?

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.