Skip to content

Allows to extract a single database from a collective dump or purge the full dump from a single database.

License

Notifications You must be signed in to change notification settings

canonex/dumpSeparator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DumpSeparator

Allows to extract a single database from a collective dump or purge the full dump from a single database.

Db tools

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).

List example

To list all the databases in a dump:

./dumpSeparator.sh list myDump.sql

Extract example

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.

Purge example

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.

How to create a mysql dump?

You can create a dump using the mysqldump utility, for MySql and MariaDb. You want an automatic procedure? Try using backupMysql

About

Allows to extract a single database from a collective dump or purge the full dump from a single database.

Topics

Resources

License

Stars

Watchers

Forks

Languages