Opened 3 years ago

Closed 3 months ago

#579 closed enhancement (fixed)

dbdump: dump only certain tables

Reported by: simko Owned by: simko
Priority: major Milestone: v1.2
Component: MiscUtil Version:
Keywords: Cc:

Description

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.

Change History (12)

comment:1 Changed 3 years ago by simko

  • Type changed from defect to enhancement

comment:2 Changed 3 years ago by rajimene

  • Owner set to rajimene
  • Status changed from new to assigned

comment:3 Changed 3 years ago by rajimene

  • Status changed from assigned to in_work

comment:4 Changed 3 years ago by rajimene

  • Status changed from in_work to in_merge

comment:5 Changed 3 years ago by rajimene

  • Status changed from in_merge to assigned

comment:6 Changed 3 years ago by rajimene

  • Status changed from assigned to in_work

comment:7 Changed 3 years ago by rajimene

  • Status changed from in_work to in_merge

comment:8 Changed 15 months ago by skaplun

  • Milestone set to v1.2

comment:9 Changed 15 months ago by skaplun

Hi Raquel,

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

Cheers,

Sam

comment:11 Changed 11 months ago by simko

  • Owner changed from rajimene to simko
  • Status changed from in_merge to in_review

comment:12 Changed 3 months ago by skaplun

  • Resolution set to fixed
  • Status changed from in_review to closed

In 92ebb163ba734ba792feede758887d8a9ee2326a/invenio:

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@…>
Co-authored-by: Raquel Jimenez Encinar <raquel.jimenez.encinar@…>

Note: See TracTickets for help on using tickets.