Re: [dspace-tech] Edititing handle uri

2019-04-10 Thread Alan Orth
Dear Fredrick,

How many items do you have? If it's only a few hundred the easiest option
is to export the community as a CSV via the XMLUI with the "Export
Metadata" function, search / replace the URLs in a text editor, and then
re-upload it. To make things easier you can remove all columns except `id`
and `dc.identifier.uri` and DSpace will only consider that field for
changes (also, this avoids possible issues with UTF-8 encoding of special
characters like accents in other fields if you use the evil Microsoft
Excel!).

The other option is to update the values directly in PostgreSQL, but it's
much more technical and very dangerous (take a database backup first!). I
like to do this in a transaction, so just in case the results aren't quite
what I expect I can ROLLBACK or COMMIT after:

dspace=# BEGIN;
dspace=# UPDATE metadatavalue SET text_value=regexp_replace(text_value, '
http://ucudir.ucu.ac.ug/xmlui/handle', 'https://hdl.handle.net') WHERE
resource_type_id=2 AND metadata_field_id=25 AND text_value LIKE '
http://ucudir.ucu.ac.ug/xmlui/handle%';
dspace=# COMMIT;

Note that in this case the metadata_field_id for `dc.identifier.uri` is 25
and I'm not sure if it's always the same on every DSpace installation.
Check the registry first:

dspace=# SELECT metadata_field_id FROM metadatafieldregistry WHERE
metadata_schema_id=1 AND element='identifier' AND qualifier='uri';

Good luck,

On Wed, Apr 10, 2019 at 11:20 AM odongo fredrick 
wrote:

> Hello DSpace Team,
> I configured our handle server but later realized that the handle URI was
> being generated with our domain name (
> http://ucudir.ucu.ac.ug/xmlui/handle/20.500.11951/232)
> I later found out the problem and corrected it and now all other items are
> having the correct URI (https://hdl.handle.net/20.500.11951/832)
> My question is, how can I change the URIs  that had already been
> generated? example from
> http://ucudir.ucu.ac.ug/xmlui/handle/20.500.11951/232 to
> 
> https://hdl.handle.net/h 
> andle/20.500.11951/232
> Thank you
> Fredrick
>
>
> --
> All messages to this mailing list should adhere to the DuraSpace Code of
> Conduct: https://duraspace.org/about/policies/code-of-conduct/
> ---
> You received this message because you are subscribed to the Google Groups
> "DSpace Technical Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dspace-tech+unsubscr...@googlegroups.com.
> To post to this group, send email to dspace-tech@googlegroups.com.
> Visit this group at https://groups.google.com/group/dspace-tech.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Alan Orth
alan.o...@gmail.com
https://picturingjordan.com
https://englishbulgaria.net
https://mjanja.ch
"In heaven all the interesting people are missing." ―Friedrich Nietzsche

-- 
All messages to this mailing list should adhere to the DuraSpace Code of 
Conduct: https://duraspace.org/about/policies/code-of-conduct/
--- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.


[dspace-tech] Edititing handle uri

2019-04-10 Thread odongo fredrick
Hello DSpace Team,
I configured our handle server but later realized that the handle URI was 
being generated with our domain name (
http://ucudir.ucu.ac.ug/xmlui/handle/20.500.11951/232)
I later found out the problem and corrected it and now all other items are 
having the correct URI (https://hdl.handle.net/20.500.11951/832)
My question is, how can I change the URIs  that had already been generated? 
example from http://ucudir.ucu.ac.ug/xmlui/handle/20.500.11951/232 to 

https://hdl.handle.net/h 
andle/20.500.11951/232
Thank you
Fredrick


-- 
All messages to this mailing list should adhere to the DuraSpace Code of 
Conduct: https://duraspace.org/about/policies/code-of-conduct/
--- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.