Hi Samuele, Tibor et.al.,

with my little helper … 

        from invenio.bibupload_regression_tests import 
wipe_out_record_from_all_tables
        
        def wipe(from_rec,to_rec):
                for rec in range(from_rec,to_rec+1):
                        print "deleting record %d" % rec
                        wipe_out_record_from_all_tables(rec)
                        
        wipe(1,691)

… I deleted all of my test records, thank you!
(The few documents that I need I can upload again.)

„wipe_out_record_from_all_tables“ would be even nicer, if it would return a 
success/error code, if the record existed at all.
But hopefully I’ll never need it again.

But the search page still lists 181 records, like before. In the search 
results, these are now empty, though.

The same after „bibdocfile —expunge“, that told me:
WARNING: No record in the database
WARNING: no MARC to upload.

inveniogc, bibindex, bibrank, webcoll, bibsort are running in auto mode. What’s 
missing? 


BTW: Maybe it would make sense to add the hints about deleting to the „Howto 
run“ page? I attach my writeup to copy from, if you like.


Greetlings, Hraban
---
http://www.fiee.net
https://www.cacert.org (I'm an assurer)


INVENIO administration and updates for UCA eBilim

by Henning Hraban Ramm, version 2013–11–13.

for UCA eBilim project.

(c) UCA 2013. License: GNU Free Documentation License.

Update changes from git

su bob
cd ~/workspace/invenio
git pull
automake-1.9 -a
autoconf
./configure
make
sudo make install
sudo chown -R www-data.www-data /opt/invenio
sudo -u www-data /opt/invenio/bin/inveniocfg --update-all
sudo service apache2 restart

Update translations

su bob
cd ~/workspace/invenio/po
make update-gmo
sudo make install
sudo chown -R www-data.www-data /opt/invenio
sudo -u www-data /opt/invenio/bin/inveniocfg --update-all
sudo service apache2 restart

Upgrade Invenio changes

su bob
cd ~/workspace/invenio
git pull
sudo -u www-data /opt/invenio/bin/bibsched stop
sudo -u www-data make check-upgrade
sudo -u www-data $INV_BASE_TARGET/bin/inveniocfg --upgrade
# see hints in output what else to run!
sudo -u www-data $INV_BASE_TARGET/bin/inveniocfg --update-all
sudo -u www-data /opt/invenio/bin/bibsched start

Running scheduled tasks

sudo -u www-data /opt/invenio/bin/bibsched

Batch-uploading new data

cd /opt/invenio/var/tmp
mkdir upload
cd upload
# copy your file tree here
sudo touch metadata.xml
sudo chown www-data.www-data *
sudo -u www-data /opt/invenio/bin/bibconvert -b'<collection>' -c/home/bob/workspace/invenio/tools_uca/bibconvert.cfg -e'</collection>' < metadata.txt > metadata.xml
sudo -u www-data /opt/invenio/bin/bibupload -i metadata.xml
sudo rm -rf /opt/invenio/var/tmp/upload/*
  • See also BibUpload Admin Guide
  • Copy your files (directory tree) for uploading to /opt/invenio/var/tmp/upload; BibUpload needs an absolute path.
  • Replace metadata.txt with your filename.

Delete records

(Information by Samuele Kaplun of CERN)

Generally, Invenio is meant as a digital archive, so deleting is difficult.

Setting MARC field 980__c to DELETED will exclude the record from all the indexes and collections, and will basically make it unavailable. However it’s still there and all its files will still be stored on disk.

You can delete files attached to records with bibdocfile --expunge.

In the latest Invenio master branch there is a hidden facility in the bibupload_regression_test module to wipe completely any trace of records created by regression test. If what you want to do is wiping tests records you can do:

$ sudo -u www-data python
>>> from invenio.bibupload_regression_tests import wipe_out_record_from_all_tables
>>> wipe_out_record_from_all_tables(123)
>>> ^d

Of course use this with care as it will completely erase any trace of a record and the referenced files.

Helper for deleting several records:

from invenio.bibupload_regression_tests import wipe_out_record_from_all_tables

def wipe(from_rec,to_rec):
    for rec in range(from_rec,to_rec+1):
        print "deleting record %d" % rec
        wipe_out_record_from_all_tables(rec)

wipe(1,11)

Attachment: administration_uca.md
Description: Binary data

Reply via email to