[Dspace-tech] handle-server setup

56 views
Skip to first unread message

Lewatle Phaladi

unread,
Aug 25, 2015, 1:02:32 PM8/25/15
to dspac...@lists.sourceforge.net

Hi All

I was setting up handle server for my University, and everything went well in such a way that changes apply only for new submissions, if we submit or import a file the file will take a new prefix not default like 123456789,

What we really need is to change the default handle prefix e.g 123456789 to all our previous stored digital files and even to the new imported or submited file.

Regards
Lewatle

This communication is intended for the addressee only. It is confidential. If you have received this communication in error, please notify us immediately and destroy the original message. You may not copy or disseminate this communication without the permission of the University. Only authorized signatories are competent to enter into agreements on behalf of the University and recipients are thus advised that the content of this message may not be legally binding on the University and may contain the personal views and opinions of the author, which are not necessarily the views and opinions of The University of the Witwatersrand, Johannesburg. All agreements between the University and outsiders are subject to South African Law unless the University agrees in writing to the contrary.

Kim Shepherd

unread,
Aug 25, 2015, 1:02:37 PM8/25/15
to Lewatle Phaladi, dspac...@lists.sourceforge.net

Hi Lewatle,

 

In your [dspace]/bin directory, there is a script called “update-handle-prefix”

 

If, for example, your new handle is 858585:

 

[dspace]/bin/update-handle-prefix 123456789 858585

 

This will update the old handles with a default handle prefix without bothering your new, correct items/collections/communities.

 

Cheers,

 

Kim

Lewatle Phaladi

unread,
Aug 25, 2015, 1:02:42 PM8/25/15
to Kim Shepherd, dspac...@lists.sourceforge.net

Hi Kim

This is what i did :

root@dspace-desktop:/usr/local/dspace1.5.2/dspace/bin# bash update-handle-prefix 123456789 36547
If you continue, all handles in your repository with prefix 123456789 will be updated to have handle prefix 1900

2357 items will be updated.

Have you taken a backup, and are you ready to continue? [y/n]: y
Updating handle table... 2357 items updated
Updating metadatavalues table... Exception in thread "main" org.postgresql.util.PSQLException: ERROR: more than one row returned by a subquery used as an expression
        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.updateQuery(DatabaseManager.java:390)
        at org.dspace.handle.UpdateHandlePrefix.main(UpdateHandlePrefix.java:97)




How can I fix that error.

Thanks

Lewatle Phaladi

unread,
Aug 25, 2015, 1:02:46 PM8/25/15
to Kim Shepherd, dspac...@lists.sourceforge.net

Hi

As my [dspace]/dspace/bin/update-handle-prefix gives error, I also come with an idea of modifying the handle table and change 123456789/ handle prefix

I tried on one collection it worked, but I need an SQL statement that will update only 123456789 and leave other value, If you can check the values in handle table and specifically handle column start with prefix and followed by id like
123456789/7135

SQL statement that can alter our prefix (123456789) only in that column and leaves the id (/7135)

I was using the statement :

Table name is handle
Column name is also handle
                          
  dspace=> UPDATE handle SET handle = '85642/7178' WHERE handle = '123456789/7178';

that worked for updating single item,
we need to update them simultaneously.

Regards
Lewatle







-----Original Message-----
From: Kim Shepherd [mailto:ki...@waikato.ac.nz]
Sent: Thu 8/27/2009 10:22 PM
To: Lewatle Phaladi; dspac...@lists.sourceforge.net
Subject: RE: [Dspace-tech] handle-server setup

François Parmentier

unread,
Aug 25, 2015, 1:02:48 PM8/25/15
to Lewatle Phaladi, dspac...@lists.sourceforge.net
May I suggest to use update-handle-prefix?
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus
> on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> DSpace-tech mailing list
> DSpac...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/dspace-tech
>
>

Bhavesh Patel

unread,
Mar 14, 2016, 11:44:00 PM3/14/16
to DSpace Technical Support, Lewatle...@wits.ac.za, dspac...@lists.sourceforge.net, ki...@waikato.ac.nz
Dear Kim,

We have used the same "Updating Existing Handle Prefixesto update the previous handle prefix but somehow the script not working properly.

It's only update records from 'handle' table it's throw an error while updating records in 'metadatavalue' table. (please see the attached screen sort)

Please help us to resolve this issue.

Version: DSpace 4.1 
OS: CentOS 6.5

Regards,
Bhavesh
handle_prefix_update_error1.PNG
Reply all
Reply to author
Forward
0 new messages