Knowledgebase article 118

Converting MyISAM to InnoDB tables (engine change)


MyIsam tables can cause problems in eHD, especially when you upgrade. Here are the steps to change your database from MyIsam to InnoDB

 ***Do not change anything in your existing database, always use a backup copy***

 


The usual transaction rollback functionality that we rely on doesn't work with MyIsam tables. We'll need to switch the table types from MyIsam to InnoDB. Before doing this, please ensure you have a CURRENT BACKUP of your database. Once that is done the conversion can take place. The usual way we do this is:

1 - Export current ehd data with mysqldump

     To do this, use the mysqldump command as such:

     mysqldump -u (username) -p (password) (dbname) > filename

2 - Edit the mysql my.cnf to make InnoDB the default table type

     the my.cnf file is located in the following locations:

     Windows - C:\<Installdir>\my.cnf (EG C:\program files\mysql\

     Linux - /etc/mysql/my.cnf

     In the [mysqld] section, type in the line "default-storage-engine = innodb" without the quotes. If this line exists already, change it.

3 - Open the dump file, search for MyISAM and replace with InnoDB

4 - Create a new database for ehd (this will create a New DB with InnoDB as the default table type)

5 - Import the modified dump file into the New DB

6 - Configure ehd to point to the new database

 

This may or may not work the first time, as the InnoDB tables will have stricter rules, so some data cleanup may need to be done.

 

 

 For MySQL gui tools users:

1.  Make a backup of your MYSQL database.

2.  Open that backup as a script. (File, Open Script)

3.  Search for MyISAM and replace with InnoDB. (Icon at the top)

4.  Save the script. (Icon at the top)

5.  Execute the script into a new database. (At the top of your script there is a line that states which database to use, change it so you don't affect your existing data)

6.  Connect eHD to the new database.  (sign in as Admin and go to the Database Connection screen and enter the new information.   It will be necessary to stop and then restart your application server)

 

Group eHD Standard Support Last modified Nov 13, 2019 Type Public Viewed 2715