We have recently improved the schema of our production database, changing column names and indexes etc. We also changed the storage engine to InnoDB to make use of transactions and foreign keys.
What is the best way to import the data from the old schema into the new schema? Bare in mind that column names have changed (including primary keys).
As if you have changed the column names you may create out files and import.
and then you may do LOAD Data:
References:
Otherwise if possible following will do the job as far as number of columns are same:
insert into new-table select * from old-table;
If number of columns are not same then:
insert into new-table select col1,col2,… from old-table;