Allows to extract a single database from a collective dump or purge the full dump from a single database.
Huge mysql dump that contains many databases are not manageable from any text editor (Joe https://joe-editor.sourceforge.io/ is one of the few). This bash script uses sed to quickly edit those files.
Warning This script has not been extensively tested and it is supposed to work for moderate size dump (<10Gb).
To list all the databases in a dump:
./dumpSeparator.sh list myDump.sql
To extract a single database dump:
./dumpSeparator.sh extract myDatabase myDump.sql
This command will create a backup file and a new file with only the myDatabase dump.
To purge a huge database dump from a single not useful database:
./dumpSeparator.sh purge myDatabase myDump.sql
This command will create a backup file and a new file without the myDatabase dump.
You can create a dump using the mysqldump utility, for MySql and MariaDb. You want an automatic procedure? Try using backupMysql