Pass tables from MyISAM to InnoDB in MySQL

1

I have a database that stores content from several years ago in various tables.

All the tables are currently in MyISAM and I want to pass them all to InnoDB .

How could I do it without risk of data loss?

I do not put what I have tried so far, because in fact I have not tried anything, it is a delicate step and I do not want to put the data at risk.

Although MyISAM does not handle restrictions, and now I do intend to use restrictions (when migrating them to InnoDB ), there are no problems, in the process of inserting data in the table it has been observed that there are no records orphans (although there may be two or three). What I want to say is that the issue of restrictions would not be a major difficulty.

Thanks for the help.

P. D.: I would appreciate the response of someone who has experience in this type of migration.

    
asked by A. Cedano 17.01.2018 в 19:01
source

1 answer

1

Once I did it and I had no problems, I think it is more problematic when you do it the other way around the issue of foreign keys, although honestly I am not an expert. First of all make a backup, in case something will fail. Just use the following command (although it is per table):

ALTER TABLE 'tabla' ENGINE=INNODB

I leave an article that you could read (English) about the possible problems: link .

IMPORTANT: Always back up your information in case you run into problems.

    
answered by 17.01.2018 в 19:41