Migrate metadata from one collection to another

37 views
Skip to first unread message

Karol S

unread,
Oct 4, 2019, 9:34:48 AM10/4/19
to DSpace Community
Hi!

Hi, i trying move items from one collection (handle: 1234/10) to another collection (handle 1234/20).

I using:

* metadata export from 1234/10 on website ( I exporting csv file)
* i changing handlein csv file from 1234/10 to 1234/20 
* /dspace metadata-import -f file.csv

and.... a lot of collections working fine, but i have a few wchich i can't fully import for example: i exported 500 items but when i trying import i see only 100 items to import( in csv file i see 500 records). Why, what it could be wrong?

Thank You,

Karol

Tim Donohue

unread,
Oct 4, 2019, 10:24:58 AM10/4/19
to Karol S, DSpace Community
Hi Karol,

It's hard to say exactly what may be going on.  But, sometimes it helps to simplify the CSV you are importing.  So, if they *only* change you want to make is to move some Items from one Collection to another, then you should be able to delete every column from the CSV *except the 'id' column and 'collection' column*  (as any missing columns are ignored).  Then update the 'collection' column to the new Collection's handle and do the import.  More info on simplifying these CSVs before importing can be found in the docs here (see the blue note named "Tips to Simplify the Editing Process"): https://wiki.duraspace.org/display/DSDOC6x/Batch+Metadata+Editing#BatchMetadataEditing-EditingtheCSV

If it still isn't working, you may want to also check your DSpace log files to see if any error is appearing there when you do the import.

Let us know on this list if you have further questions.

Tim

From: dspace-c...@googlegroups.com <dspace-c...@googlegroups.com> on behalf of Karol S <karols...@gmail.com>
Sent: Friday, October 4, 2019 8:19 AM
To: DSpace Community <dspace-c...@googlegroups.com>
Subject: [dspace-community] Migrate metadata from one collection to another
 
--
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 Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-communi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-community/d70461a0-cef3-4dda-a8e7-f289b17b34d8%40googlegroups.com.

Tim Donohue

unread,
Oct 4, 2019, 1:45:32 PM10/4/19
to Karol S, DSpace Community
Hi Karol,

A CSV file is a spreadsheet format. So, often the best way to open it to remove columns is using either Microsoft Excel or OpenOffice / LibreOffice.  You also might be able to use Google Sheets.  Just remember though to save the results as a CSV.  If you choose to use Excel, there's hints in the docs that detail the best way to open the file (as Excel sometimes has difficulty with UTF-8 CSV files): https://wiki.duraspace.org/display/DSDOC6x/Batch+Metadata+Editing#BatchMetadataEditing-EditingtheCSV

Tim

From: Karol S <karols...@gmail.com>
Sent: Friday, October 4, 2019 11:05 AM
To: Tim Donohue <tim.d...@lyrasis.org>
Cc: DSpace Community <dspace-c...@googlegroups.com>
Subject: Re: [dspace-community] Migrate metadata from one collection to another
 
Tim, 

thank you, sounds good. Before my question i didn't need open csv file  (i used linux command "sed" to change handle number). Which is the best option to delete other columns from csv file? Regards,

Karol

Mark H. Wood

unread,
Oct 6, 2019, 2:03:43 PM10/6/19
to DSpace Community
Another tool that understands CSV (and a number of other tabular
formats) is Miller:

https://github.com/johnkerl/miller

"Miller is like awk, sed, cut, join, and sort for name-indexed data
such as CSV, TSV, and tabular JSON" -- from the Github repo.

Very handy for big jobs and scripting of repetitive tasks, since it's
CLI.

--
Mark H. Wood
Lead Technology Analyst

University Library
Indiana University - Purdue University Indianapolis
755 W. Michigan Street
Indianapolis, IN 46202
317-274-0749
www.ulib.iupui.edu
signature.asc

Karol S

unread,
Oct 7, 2019, 3:42:02 AM10/7/19
to Tim Donohue, DSpace Community
Tim,

I migrated all collections succesfully - thank You:). In my case Libre Office, was preety easier than Excel to delete collumn and save csv file.
So, after migration all collections, should I rebuild index using ( index-rebuilt -f )  or something like this? Have a nice day,

Karol
 

Karol S

unread,
Oct 7, 2019, 5:09:16 AM10/7/19
to DSpace Community
Hi Mark,

thank You for tip, i will check this tool next time. Regards,

Karol 

--
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 Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-communi...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages