I am trying to move some of the older partitions from larger tables located at the main data directory to another drive/mount point on the same server. I want all the partitions/tables to be accessible and live after moving. Based on some of the research I have found online, are the following steps safe to execute:? (on a high level)
flush tables table for export
Move the
/var/lib/mysql/database/table
.ibd and .cfg files to an alternate location, i.e.~/
Unlock the MySQL tables
show
create table <table>
drop table <table>
Create table table with the
DATA DIRECTORY = '/path'
optionAlter table table discard tablespace
copy all those copied .ibd and .cfg files from the
~/
directory to the/path/
directoryAlter table table import tablespace
My innodb tables are partitioned monthly and the sizes are pretty big for each .ibd file which represents each partition for the table.
MySQL version = 5.7, hosted on Ubuntu 12.04.