I have a production database cluster (innodb if it matters) that has to be regularly backed up and imported into a development environment.
Currently I am using a basic mysqldump
to generate a *.sql
file that is transferred into the dev environment and imported.
The problem is the file size is now around 3.9Gb and takes over an hour to import. There has to be a faster way to do this as expanding the innodb cluster only takes a matter of minutes and accomplishes a full database mirror.
I tried using the mysqldump --tab=dir
method but that exports all the tables essentially in alphabetical order so when trying to import the table *.sql
files it fails on foreign keys.
Is there a way to get mysqldump
to properly export tables and data separately so that it can be imported?
Is there a better way to handle this data transfer so that it does not take >1hr to import into our dev environment?
date
type of method would not work.