On Thu, 08 Nov 2012, Giovanni Di Milia wrote:
> which is the quickest and easiest way to extract the collections
> configuration of WebSearch and apply it on another instance of
> Invenio?

If you think about replicating collection definitions and the tree, then
something like the following is enough:

On source node:

  $ mysqldump --skip-opt --add-drop-table -u root -p invenio collection > c.sql
  $ mysqldump --skip-opt --add-drop-table -u root -p invenio 
collection_collection > cc.sql

On target node:

  $ cat c.sql | /opt/invenio/bin/dbexec
  $ cat cc.sql | /opt/invenio/bin/dbexec

Notes:

* Adding `--skip-opt' permits to easily grep away some wanted/unwanted
  values from the dump.

* If the site name on the target node is different, then you may want to
  amend name of your home collection (ID=1) to be the same as the target
  site name, e.g. by running:

     $ sudo -u www-data /opt/invenio/bin/inveniocfg --reset-sitename

* Obviously you could do such a dump/load for other collection-related
  tables as well, such as `collection_portalbox' and the joined table
  `portalbox', not only for the above two tables.  See:

     $ echo "SHOW TABLES" | /opt/invenio/bin/dbexec | grep -i colle

  Depends on what exactly you are transferring: everything or only some
  parts.

* See also `inveniocfg_dumperloader.py', but this is experimental.  With
  the recent move to the SQLAlchemy, the dumper/loader tool will become
  more functional.  We thought of using Python Fixture format for the
  exported configuration file, so that it would also become more
  comfortably editable.  We can talk about the dumper/loader tool next
  week, if that interests you.

Best regards
-- 
Tibor Simko

Reply via email to