Jeff,

 

I have encountered this issue before. My solution was to move the community
via direct SQL queries to the Postgres database. I am using pgAdmin III to
connect to the database and execute the appropriate queries. That is
available as a download from the main PostgreSQL website. The Dspace
database includes tables called "community2collection" and
"communities2item" which associates each collection with its owning
community and each item with its owning community/communities. These tables
do not consider handle IDs. So, changes that are made to them will not
affect handles. A separate table in the database associates handles to the
various objects managed by Dspace.

 

I did not write a script for this but you should consider the following
steps:

 

1.      Identify the community_id of the old community, the community_id new
community, the collection_id of the collection you want to move, and the
list of every item_id in that collection.
2.      Delete the row in the community2collection table that contains the
old community_id and the moving collection_id.
3.      Insert a new row into the community2collection table that contains
the new community_id and the moving collection_id.
4.      Delete all rows in the communities2collection table that contain
each item_id in the moving collection and the old community_id.
5.      Insert new rows into the communities2collection table that contain
each item_id in the moving collection and the new community_id.
6.      The collection should and items contained in that collection should
now appear under the new community with handles intact.

 

If you are really ambitious, you could use an update query to achieve steps
2 and 3 although that would not a good idea to achieve steps 4 and 5 since
there may be items in other collections within that community that you do
not want to move. Make sure to triple check your queries for accuracy before
you run them as it is really easy to modify more rows than you intended.
Also, it may be a good idea to backup the database before you run any
insert, delete, or update queries so that you can restore the database to
its original state if something goes wrong.

 

As I said, I have not written a general script for this, but I would be
willing to look into the possibility of writing this as a function or stored
procedure to be added to the Dspace database. Ideally, a new page or form
could be built on top of such a function to make it accessible from the user
interface. I could provide you with some sample SQL code if it would help.
Good luck.

 

Kyle Kaliebe
Systems Developer/Engineer
Knowledge Bank
University Libraries
Ohio State University
[EMAIL PROTECTED]

  _____  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jeffrey
Trimble
Sent: Friday, April 25, 2008 15:40
To: dspace-tech@lists.sourceforge.net
Subject: [Dspace-tech] moving a collection to a different community

 

Does anyone have a script to move a collection from one community to
another? While I could

export the data and re-import it, I'm afraid that I might loose the handle
ID.

 

Now, if I retain the handle file, and do not delete the handle from the
metadata (edit the

migrate script a little), would this work when I re-import?

 

Any comments, caution?

 

TIA,

 

Jeff

Jeffrey Trimble

Systems Librarian

Maag Library

Youngstown State University

330-941-2483 (Office)

[EMAIL PROTECTED]

http://www.maag.ysu.edu

http://digital.maag.ysu.edu

 

 

 

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to