changing mysql to innodb_file_per_table=1 with lvm and replication almost without downtime
This conversion was made with mysql 5.5, but it should work with older versions, as replications on mysql were introduced since mysql 3.23.15. Don’t forget the Disclaimer !!! It requires more than the basic knowledge in linux, lvm and mysql. I do NOT take ANY responsibility for Your data loss!!! Long story short:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
enable mysql bin logs create lvm snapshot mark master status - start 2'nd mysql instance from snapshot dump all data - start new mysql instance with innodb_file_per_table=1 in new data_dir start import of dumped data start replication from master - when slave=master stop both servers move slave data_dir to /var/lib/mysql and start main mysql instance. |
LET’S BEGIN: