Tuesday, June 27, 2017

Splitting huge dump files

When importing a very big sql dump, it is possible that some configurations do not allow a correct upload in one's db (ie myisam vs innodb) or you may need to import only part of the tables.
If the dump is big enough to make any edit impossible, you may need to split it.

I found a very handy tool SQLdumpsplitter.


It has a very simple inteface and it allows to chose the size of split files and if to skip comment lines;
it also creates a separate file for the create tbales statements.
Then you can reassemble the parts you need with a dos line:
copy *.sql new.sql