Mysql – Move MySQL tables and data from storage engine MyISAM to InnoDB

innodbmyisamMySQL

This question is probably for MySQL experts and admins that have done this sort of migration before.

I have 17 MySQL tables, triggers and stored procedures on MyISAM storage engine. These tables have around 8 MiB data combined. Since I am moving the application and database to Amazon EC2 and RDS I was wondering what are the key considerations when migrating tables from MyISAM to InnoDB.

The steps that I will be going through are pretty much as follows.

  1. System Tables on AWS RDS has to be on MyISAM so no contest on that.
  2. Create 17 tables with the same structure as they exist on MyISAM and build them in RDS InnoDB.
  3. Export Data from the MyISAM tables and import them in to the new tables created in RDS on InnoDB.
  4. Create the Triggers, Stored Procedures and Functions in the InnoDB database.

When I ask about key considerations of a migration like this across MySQL storage engines I want to know from the point of view of experienced admins if something explicitly needs to be taken care of at the DB level during the data migration etc so that the DB behaves the way it should and there are no glitches. I am worried mainly because I read that InnoDB and MyISAM's way of buffering, I/O, CPU and Memory usage are different.

I will happily accept your 2 cents on this process.

Thanks.

*Update*

innodb_buffer_pool_size – {DBInstanceClassMemory*3/4} This is what it is set to right now.

I am looking for other parameters as well. Let me know if you want to see values set for any other specific parameters.

Best Answer

There are many differences between MyISAM and InnoDB but the main points that you should be aware of before the migration., 1. Data backups cannot be done by simply copying over files as in MyISAM 2. InnoDB does not work in an optimized way when run with default options, you will have to configure and tune according to your needs,. 3. InnoDB does not have compressed indexes like MyISAM so its going to take more space 4. InnoDB automatically appends primary key columns to secondary keys,. so make sure primary key columns are not large.,

Apart from that migration should be easy,. 1. Create tables with similar structures as the MyISAM but only with the engine changed to InnoDB. 2. Dump the data from the MyISAM table 3. Import the data in primary key order in the InnoDB engine wrapping the import between START TRANSACTION and COMMIT., this is the fastest way to load data,. 4. Create the stored procedures and trigger.,. but they have nothing to do with the storage engine,.

You can let me know if you need any help with the InnoDB configuration,.

Related Topic