cli way of changing dc.identifier.uri for all items?

447 views
Skip to first unread message

Tony Brian Albers

unread,
Jan 8, 2018, 4:58:22 AM1/8/18
to dspac...@googlegroups.com

Hi Guys,

We've had to change domain name on one of our installations, is there a
way using the command-line to change the metadata for all items? I'd
like to change the dc.identifier.uri

TIA,

/tony
--
Tony Albers
Systems administrator, IT-development
Royal Danish Library, Victor Albecks Vej 1, 8000 Aarhus C, Denmark.
Tel: +45 2566 2383 / +45 8946 2316

Christian Scheible

unread,
Jan 8, 2018, 5:01:23 AM1/8/18
to dspac...@googlegroups.com
Hi Tony,

yes there is. Just export, edit and import again.
See : https://wiki.duraspace.org/display/DSDOC6x/Batch+Metadata+Editing
for details.

Kind Regards
Christian

Tony Brian Albers

unread,
Jan 9, 2018, 3:29:37 AM1/9/18
to dspac...@googlegroups.com
Thanks Christian, but it doesn't work.

When I change the dc.identifier.uri field and import, it just says: "
There were no changes detected"

Really odd.

Any suggestions?

/tony

Tom Desair

unread,
Jan 9, 2018, 4:24:58 AM1/9/18
to dspac...@googlegroups.com
Hi Tony,

I usually do this with a SQL query (for DSpace 5 or 6, on PostgreSQL):

update metadatavalue
set text_value = regexp_replace(text_value, 'http://my-old.url.org', 'https://my-new.url.org') where metadata_field_id IN (select metadata_field_id from metadatafieldregistry where element = 'identifier' and qualifier = 'uri');
 
After the update you need to reindex the discovery search index and the oai index:
  • bin/dspace index-discovery -f
  • bin/dspace oai import -c

Best regards,

Tom

 
logoTom Desair
250-B Suite 3A, Lucius Gordon Drive, West Henrietta, NY 14586
Gaston Geenslaan 14, Leuven 3001, Belgium
www.atmire.com

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to dspac...@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.

Christian Scheible

unread,
Jan 9, 2018, 4:58:10 AM1/9/18
to dspac...@googlegroups.com
Hi Tony,

I am not sure. I just tested it with our DSpace 6.2 and it did work.
We also did use this option on our 5.x instance.

Just make sure you are not changing the column header and that the item
id is in the first column.

Kind Regards
Christian

Tony Brian Albers

unread,
Jan 9, 2018, 5:15:30 AM1/9/18
to dspac...@googlegroups.com
Hi Tom,

That worked like a charm.

Thanks!

/tony

On 01/09/2018 10:24 AM, Tom Desair wrote:
> Hi Tony,
>
> I usually do this with a SQL query (for DSpace 5 or 6, on PostgreSQL):
>
> update metadatavalue
> set text_value = regexp_replace(text_value, 'http://*my-old.url.org
> <http://my-old.url.org>*', 'https://*my-new.url.org
> <http://my-new.url.org>*') where metadata_field_id IN (select
> metadata_field_id from metadatafieldregistry where element =
> 'identifier' and qualifier = 'uri');
>
> After the update you need to reindex the discovery search index and the
> oai index:
>
> * bin/dspace index-discovery -f
> * bin/dspace oai import -c
>
> Best regards,
>
> Tom
>
> logo Tom Desair
> 250-B Suite 3A, Lucius Gordon Drive, West Henrietta, NY 14586
> Gaston Geenslaan 14, Leuven 3001, Belgium
> www.atmire.com
> <http://atmire.com/website/?q=services&utm_source=emailfooter&utm_medium=email&utm_campaign=tomdesair>
>
>
> 2018-01-09 9:29 GMT+01:00 Tony Brian Albers <t...@kb.dk <mailto:t...@kb.dk>>:
> Tel: +45 2566 2383 <tel:%2B45%202566%202383> / +45 8946 2316
> <tel:%2B45%208946%202316>
>
> --
> 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...@googlegroups.com
> <mailto:dspace-tech%2Bunsu...@googlegroups.com>.
> To post to this group, send email to dspac...@googlegroups.com
> <mailto:dspac...@googlegroups.com>.
> <https://groups.google.com/group/dspace-tech>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
> --
> 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...@googlegroups.com
> <mailto:dspace-tech...@googlegroups.com>.
> To post to this group, send email to dspac...@googlegroups.com
> <mailto:dspac...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/dspace-tech.
> For more options, visit https://groups.google.com/d/optout.


Tony Brian Albers

unread,
Jan 11, 2018, 7:57:05 AM1/11/18
to dspac...@googlegroups.com
Darn, I think I was celebrating too soon.

In our dspace/log, cocoon.log files have increased from around
150mbytes/day to 3,5gigs/day.

Errors are like these:

2018-01-11 13:45:46,947 INFO org.apache.cocoon.i18n.XMLResourceBundle
- Bundle
<file:///data/dspace/webapps/ROOT/i18n/aspects/Discovery/messages.xml>
not loaded: Source URI not found

2018-01-11 13:45:46,828 ERROR cocoon.handled - Unable to locate sitemap
at <map:read type="SitemapReader"> -
file:///data/dspace/webapps/ROOT/sitemap.xmap:595
:56
at <map:match> -
file:///data/dspace/webapps/ROOT/sitemap.xmap:594:50


What we have done is:

changed hostname in dspace's local.cfg
changed dc.identifier.uri in postgres as per below.

Any ideas?

/tony
Reply all
Reply to author
Forward
0 new messages