Skip to content

Maintenance Tasks

Alan Orth edited this page Mar 21, 2016 · 14 revisions

Maintenance Tasks

A cheat sheet for DSpace maintenance tasks. DSpace administration is tricky so this should serve as a notebook for myself as well as a resource for others to learn from me.

Moving Communities

In DSpace you move communities by changing the relationship it has with its parent. There is a tool for moving communities but it requires using the dspace command line utility.

# /path/to/bin/dspace community-filiator --remove --parent=10568/171 --child=10568/311
...
Defiliation complete. Community: '26' is no longer a child of community: '9'
# /path/to/bin/dspace community-filiator --set --parent=10568/27868 --child=10568/311
...
Filiation complete. Community: '139' is parent of community: '26'

Moving Collections (Option 1)

Unlike communities, there is no tool for moving collections. One method to move a collection to a new community, however, is to move the collection's items instead:

  • Create the collection in the new community
  • Export the metadata (CSV) of the old collection using the "Export Metadata" option in the DSpace web interface
  • Edit the collection column in the CSV to reflect the new collection
  • Re-import into DSpace web interface via "Import Metadata"
  • Edit the new collection to add authorizations from the old collection
  • Delete the old collection

This method uses DSpace's own methods for metadata editing, and should therefore be safe for any DSpace version. The downside is that the collection gets a new handle, so links to the old one won't work.

Moving Collections (Option 2)

You can alter the collection's parent community relationship using raw SQL commands. The process can be automated with a script, for example (tested with 3.x, 4.x, and 5.x): move_collections.sh

After that the collection will appear in the new community immediately, but you need to clear the Cocoon cache so that the collection's breadcrumb trail displays the correct hierarchy. I don't think a reindex is necessary after moving collections, as no metadata has changed.

Re-indexing an Item / Collection After Manual Metadata Edit

For example, deleting a metadatavalue record with an invalid dc.date.issued value (here "s.f." is Spanish for sin fecha / no date, which of course isn't ISO 8601!). In PostgreSQL:

# select * from metadatavalue where text_value='s.f.';
# delete from metadatavalue where text_value='s.f.' and resource_id='57762';
# select handle from item, handle where handle.resource_id = item.item_id AND item.item_id = '57762';

Then removing the item from the index (using the handle from above) and starting regular index update:

$ [dspace]/bin/dspace index-discovery -r 10568/56338
$ [dspace]/bin/dspace index-discovery