mysqldump restore utilities for holland
Python Shell
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
holland_restore
tests
README
runtests.sh
setup.cfg
setup.py

README

Introduction
============
holland_restore is a simple python script to parse and filter mysqldump
output.  This script currently supports:

* filtering by database, table and table-engine
* skipping routines
* skipping writing to the binary log on restore

Installing and some examples
============================
$ virtualenv test
$ . test/bin/activate
$ cd holland_restore
$ python setup.py develop
$ mysqlrestore < mydump.sql > mysqldump_copy.sql

Extract a few tables from a dump
--------------------------------
$ mysqlrestore --table mysql.user --table mysql.proc < mydump.sql > user_and_proc.sql

Extracting tables by storage engine
-----------------------------------
$ mysqlrestore --engine innodb < mydump.sql > innodb_tables.sql

Extracting only DDL (no table data)
-----------------------------------
$ mysqlrestore --no-data < mysqldump.sql > mydump_schema.sql

Combining options
-----------------
$ mysqlrestore --no-data --engine innodb --table employees.salaries < mydump.sql > custom.sql

Future features (or, it's all lies until there's code)
======================================================
* Rewrite database names, and skip USE database options
* Progress meter when piping into mysql
* More filtering options

Weird ideas
-----------
Rewriting mysqldump stream into other database formats (postgres,drizzle,etc.)
custom editing sections of a dump file, e.g.:
# [NOT IMPLEMENTED]
$ mysqlrestore --edit-ddl mydb.mytable 
[fires up EDITOR when mydb.mytable is found in dump]
[replaces mydb.mytable in stream]
list table of contents of a dump (lines #'s and byte offsets)