[Dspace-general] Moving Communities

Pat Galloway galloway at ischool.utexas.edu
Thu Dec 14 12:27:21 EST 2006


The Community Filiator does indeed work to move communities and 
subcommunities for restructuring, and they take their collections along 
with them. Here's an example that we used to restructure communities on 
our pacer.ischool.utexas.edu DSpace (which at that point was a 1.2 
installation):
----------------------------------------------------------------------------
1) Restructuring communities

The tutorials archiving group wanted to change the relationship of three 
collections and two communities to the community structure now extant. 
Below is the present state,
* = community or subcommunity, # = collection, and the handles and 
Database IDs are included after each item (note that there are 
collections under both of the last two subcommunities, but I have only 
listed the ones we need to move):

*School of Information Technology Services (123456789/334, DB=23)
*School of Information Tutorials Project (2081/1840, DB=82)
*School of Information Tutorials (123456789/335, DB=24)
#2005 Archiving Project Documentation (123456789/1190, DB=169)
#2006 Archiving Project Documentation (123456789/1329, DB=236)
#Tutorial Production Guidelines (123456789/434, DB=115)
*School of Information Tutorials Documentation (2081/1572, DB=77)

The desired outcome involves moving both communities and collections. 
First the communities: that’s the easy part (plus they take their 
collections along with them). What we want to achieve in the first step is:

*School of Information Technology Services (DB=23)
*School of Information Tutorials Project (DB=82)
*School of Information Tutorials (DB=24)
#2005 Archiving Project Documentation
#2006 Archiving Project Documentation
#Tutorial Production Guidelines
*School of Information Tutorials Documentation (DB=77)

Which means we need to move DB 24 and DB 77 from being the children of 
DB 23 to being the children of DB 82. First remove the relationship and 
orphan the subcommunities from subcommunity 23:

dsrun org.dspace.administer.CommunityFiliator –r –p 23 –c 24
dsrun org.dspace.administer.CommunityFiliator –r –p 23 –c 77

Then establish the new relationship and adopt them under subcommunity 82:

dsrun org.dspace.administer.CommunityFiliator –s –p 82 –c 24
dsrun org.dspace.administer.CommunityFiliator –s –p 82 –c 77

Next we need to move the three listed collections now under subcommunity 
24, which requires a database command. What we want to achieve here is 
to move three of the collections now under DB24 to place them under DB77:


*School of Information Technology Services (DB=23)
*School of Information Tutorials Project (DB=82)
*School of Information Tutorials (DB=24)
*School of Information Tutorials Documentation (DB=77)
#2005 Archiving Project Documentation (DB=169)
#2006 Archiving Project Documentation (DB=236)
#Tutorial Production Guidelines (DB=115)

The SQL to achieve this requires two updates for each change:
update community2collection set community_id=77 where community_id=24 
and collection_id=169;
update communities2item set community_id=77 where item_id in (select 
item_id from item where owning_collection=169);

update community2collection set community_id=77 where community_id=24 
and collection_id=236;
update communities2item set community_id=77 where item_id in (select 
item_id from item where owning_collection=236);

update community2collection set community_id=77 where community_id=24 
and collection_id=115;
update communities2item set community_id=77 where item_id in (select 
item_id from item where owning_collection=115);

Finally, you have to reindex everything: /dspace/bin/index-all
-----------------------------------------------------------------------------------------------------
Hope this helps.

Pat Galloway
School of Information
University of Texas at Austin




More information about the Dspace-general mailing list