[Dspace-tech] moving a collection to a different community
Hi, After five years or so of running DSpace, we are considering reorganizing the hierarchy and structure of our DSpace install. I've been using the dsrun CommunityFiliator commands to rearrange communities and subcommunities. I would also like to move quite a few collections to different communities. Is there a way to do this? Thanks! Best, Karen -- Karen Estlund Digital Collections Coordinator Knight Library, University of Oregon tel: 541-346-1854 email: [EMAIL PROTECTED] - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech
Re: [Dspace-tech] moving a collection to a different community
Hi Karen, there is a patch in the patch queue for moving collections, see http://sourceforge.net/tracker/index.php?func=detailaid=1741872group_id=19984atid=319984 or http://tinyurl.com/5r8yjl I have not tested it yet. You might also move the collections on db-level. Make sure you got a dump before you lay hands on the db. update community2collection set community_id=NewCommunityID where community_id=OldCommunityID and collection_id=CollectionID; Here is an example: You want to move the Collection with the ID 34 from the Community ID 3 to Community ID 7. update community2collection set community_id=7 where community_id=3 and collection_id=34; Then you got to run /dspace/bin/index-all or index-update (depends on the version you are using). Hope that helps Claudia Hi, After five years or so of running DSpace, we are considering reorganizing the hierarchy and structure of our DSpace install. I've been using the dsrun CommunityFiliator commands to rearrange communities and subcommunities. I would also like to move quite a few collections to different communities. Is there a way to do this? Thanks! Best, Karen -- Karen Estlund Digital Collections Coordinator Knight Library, University of Oregon tel: 541-346-1854 email: [EMAIL PROTECTED] - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech
Re: [Dspace-tech] moving a collection to a different community
Hi Jeffrey, the easiest way to move a collection is straight via the database. If you want to move collection id 34 from community id 3 to community id 7, do update community2collection set community_id=7 where community_id=3 and collection_id=34; Then run [dspace}/bin/index-all. Make sure you got a dump of your db, before you lay hand on it. Hope that helps Claudia 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 - 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
Re: [Dspace-tech] moving a collection to a different community
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
Re: [Dspace-tech] moving a collection to a different community
Yes, but also make sure to maintain the foreign key relationships in the communities2item table. Otherwise, individual items pages will not display the correct owning community. Kyle Kaliebe Systems Developer/Engineer Knowledge Bank University Libraries Ohio State University [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Claudia Juergen Sent: Friday, April 25, 2008 16:48 To: Jeffrey Trimble Cc: dspace-tech@lists.sourceforge.net Subject: Re: [Dspace-tech] moving a collection to a different community Hi Jeffrey, the easiest way to move a collection is straight via the database. If you want to move collection id 34 from community id 3 to community id 7, do update community2collection set community_id=7 where community_id=3 and collection_id=34; Then run [dspace}/bin/index-all. Make sure you got a dump of your db, before you lay hand on it. Hope that helps Claudia 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/javao ne___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech - 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/javao ne ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech - 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