Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

dbdump: dump only certain tables #579

Closed
tiborsimko opened this Issue · 3 comments

3 participants

@tiborsimko
Owner

Originally on 2011-04-01

Currently dbdump dumps all the tables. This is useful for site
cloning and backup purposes, but this takes time and disk space and
may not be always what we want.

It will be good to enrich dbdump CLI in order to offer more flexible
dumping options such as:

(a) --dump-all (or better said the default behaviour without any
option) will be to dump all tables, as is being done now. This is
useful for full backups.

(b) --dump-config which will dump only configuration tables such as
collections, portalboxes, submissions, etc, but no bib, idx, rnk*
and the like. (See also tabbibdrop.sql.) This is useful to port
overall configuration quickly from one site to another without
altering the site's data.

(c) --dump-data which will dump only bibliographic data and indexes
and the like. This will be useful e.g. to dump bib/idx/rnk tables
from PROD and putting them on DEV.

(d) --dump-tables [regexp1] [regexp2] [...] which is the most
flexible option that will dump only tables matching the given regexp
expressions. (See also mysqldump's own CLI options.) Useful for
porting certain tables in an ad-hoc manner.

(e) In addition, a new option --no-data may be added to the above
options which will make dbdump to dump only CREATE TABLE statements,
but no table data. (See mysqldump's own `--no-data' command.) This
is useful for comparing sites.

Note that the options b and c above are basically only handy shortcuts
for the option d so that people don't have to write expressions like
--dump-tables ^(idx|bib|rnk). However, this may be fully acceptable
too in my eyes, if we document how to use the option d, so maybe the
options b/c are not really needed... Especially since we are staying
in the DB dumper domain here; the configuration dumper domain is
covered by ongoing inveniocfg dumper/loader tool. So I guess a/d/e
options will be enough.

@kaplun
Collaborator

Originally on 2013-02-04

Hi Raquel,

where's the branch? It would be cool to have this in 1.2 :-)

Cheers,
Sam

@kaplun kaplun closed this
@kaplun
Collaborator

Originally on 2014-01-09

In 92ebb16:

#CommitTicketReference repository="invenio" revision="92ebb163ba734ba792feede758887d8a9ee2326a"
dbdump: ignore with regexp

- Introduces support for regular expressions
  when specifying which tables to ignore from
  a given dump.
  (closes #579)

- Additionally, always attaches back slave.

Signed-off-by: Samuele Kaplun <samuele.kaplun@cern.ch>
Co-authored-by: Raquel Jimenez Encinar <raquel.jimenez.encinar@cern.ch>
@kaplun kaplun referenced this issue from a commit in kaplun/invenio
@kaplun kaplun dbdump: ignore with regexp
* Introduces support for regular expressions
  when specifying which tables to ignore from
  a given dump.
  (closes #579)

Signed-off-by: Samuele Kaplun <samuele.kaplun@cern.ch>
Co-authored-by: Raquel Jimenez Encinar <raquel.jimenez.encinar@cern.ch>
e56143b
@kaplun kaplun referenced this issue from a commit in kaplun/invenio
@kaplun kaplun dbdump: ignore with regexp
* Introduces support for regular expressions
  when specifying which tables to ignore from
  a given dump.
  (closes #579)

* Additionally, always attaches back slave.

Signed-off-by: Samuele Kaplun <samuele.kaplun@cern.ch>
Co-authored-by: Raquel Jimenez Encinar <raquel.jimenez.encinar@cern.ch>
92ebb16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.