Hi Stuart , Many Thanks next time will following BatchMetadataEditing tool ,
By using dspace index-init Worked for me. Many Thanks Hafeez Qazi -----Original Message----- From: Stuart Lewis (DuraSpace JIRA) [mailto:no-re...@duraspace.org] Sent: 31 March 2011 18:56 To: dspace-devel@lists.sourceforge.net Subject: [Dspace-devel] [DuraSpace JIRA] Commented: (DS-865) Moving items ( 5000) from diffent collections under diffent communites to under one community and diffent collections ? [ https://jira.duraspace.org/browse/DS-865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=19633#action_19633 ] Stuart Lewis commented on DS-865: --------------------------------- Hi Hafeez, We would not recommend doing this directly in the database. There are several steps required, and external search and browse indexes will need to be rebuilt. Using the application, the easiest way to do this would be to use the batch metadata editor. This allows you to export the items into a CSV file, update the collection handle, and re-import it. The items will then be moved for you, and all indexes and the database updated correctly. For details, see: https://wiki.duraspace.org/display/DSDOC/System+Administration#SystemAdministration-BatchMetadataEditing We would also recommend doing this in batches, until you are confident that the process is working well for you. Thanks, Stuart > Moving items ( 5000) from diffent collections under diffent communites to > under one community and diffent collections ? > ---------------------------------------------------------------------- > ------------------------------------------------- > > Key: DS-865 > URL: https://jira.duraspace.org/browse/DS-865 > Project: DSpace > Issue Type: Task > Affects Versions: 1.6.2 > Environment: Live > Reporter: Hafeez Qazi > > Hello , > this is my first post for DSPACE . > I am trying to Moving items ( 5000) from diffent collections under diffent > communites to under one community and diffent collections ?? what is the best > method to do this ? > i treid these two SQL scripts but now getting error for reindex > update item set owning_collection=NewCollectionID where > item_id=ItemID; update collection2item set collection_id=new > collection it where collection_id= old collection; once it run these > two scripts i can see total number of items by title under new > collections but can't see them under new community . > i tried to update this table communities2item , then its showing > total number of items under community as well as differnt collections > but when i am trying to reindexing getting this error message > ./dspace index-update > Exception: org.postgresql.util.PSQLException: ERROR: duplicate key value > violates unique constraint "communities2item_pkey" > org.dspace.browse.BrowseException: org.postgresql.util.PSQLException: ERROR: > duplicate key value violates unique constraint "communities2item_pkey" > at > org.dspace.browse.BrowseCreateDAOPostgres.updateCommunityMappings(BrowseCreateDAOPostgres.java:661) > at org.dspace.browse.IndexBrowse.indexItem(IndexBrowse.java:402) > at org.dspace.browse.IndexBrowse.createIndex(IndexBrowse.java:1148) > at org.dspace.browse.IndexBrowse.main(IndexBrowse.java:703) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at > org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:212) > Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value > violates unique constraint "communities2item_pkey" > at > org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1531) > at > org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1313) > at > org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188) > at > org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452) > at > org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:354) > at > org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:308) > at > org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102) > at > org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102) > at > org.dspace.storage.rdbms.DatabaseManager.execute(DatabaseManager.java:1429) > at > org.dspace.storage.rdbms.DatabaseManager.insert(DatabaseManager.java:736) > at > org.dspace.storage.rdbms.DatabaseManager.create(DatabaseManager.java:490) > at > org.dspace.browse.BrowseCreateDAOPostgres.updateCommunityMappings(BrowseCreateDAOPostgres.java:651) > ... 8 more > Please help me to solve this issue ? > Kind Regards and manythanks > Hafeez Qazi -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://jira.duraspace.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira ------------------------------------------------------------------------------ Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf _______________________________________________ Dspace-devel mailing list Dspace-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-devel ------------------------------------------------------------------------------ Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf _______________________________________________ Dspace-devel mailing list Dspace-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-devel