<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Sep 22, 2014, at 10:20 AM, Nathan Stevens <<a href="mailto:ns96@nyu.edu">ns96@nyu.edu</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div>Copying resource records from one ASpace instance to an other, using JSON<br></div><div> could be problematic.  Those JSON resource records may have links to related records (Subjects, Agents, Accessions, Locations, Digital Objects) which won't be valid on the other ASpace instance.  Is this situation, you would either get an error, or the record would transfer, but it would be link to the wrong set related records.<br>  <br></div></div></blockquote><div><br></div><div>That’s what I was afraid of. :-( </div><br><blockquote type="cite"><div dir="ltr"><div>The solution for this problem is very challenging, and I think the safest way to do this for now is by using EAD import/export once the importers are improved in the next ASpace release.  <br><br></div><div><br></div></div></blockquote><div><br></div><div>My understanding, so far: </div><div><br></div><div>GET/POST repositories/:repo/resources/:id     returns or takes a JSONModel(:resource) </div><div><br></div><div>POST /repositories/:repo_id/batch_imports   takes a JSON array of, in the example I’ve dumped, </div><div>       jsonmodel_type:resource   and  several   jsonmodel_type:archival_object<br>and possibly other types as well. </div><div>These nodes are linked by temporary URIs like, for example:</div><div><br></div><div>   "uri" : "/repositories/import/archival_objects/import_9155986b-6520-45cc-ba43-d06e29d925e4",<br>   "resource" : {<br>      "ref" : "/repositories/import/resources/import_d04f091f-9611-4128-bb9c-91d7c4843db1"<br>   },</div><div><br></div><div>I assume those URI’s  have to match up like id/idref’s and that the batch import creates those temporary URIs </div><div>and then converts them to the permanent ids. </div><div><br></div><div>It would be nice if there were a matching API call to output the entire resource tree in that format. </div><div><br></div><div>I saw that there was a:  GET /repositories/:repo_id/resources/:id/tree  in the API, which I hoped would do that.</div><div>It appears to return the tree of archival_objects attached to the resource, but in a different format: it appears</div><div>to be a single resource tree with embedded child nodes.  ( I don’t yet know if those child nodes are complete,</div><div>or if they just represent the structure and require additional API GET calls to retrieve the children. )  </div><div><br></div><div><br></div><div>So, it would appear that I need either an external program to convert the output of a GET…/tree into the </div><div>input of a POST…/batch_imports, or else add the missing API methods to the backend. </div><div><br></div><div>Although the fact that those API methods are missing makes me think there are even more complications</div><div>that aren’t yet obvious to me.  </div><div><br></div><div><br></div><div>— Steve Majewski / UVA Alderman Library</div><div><br></div><div><br></div><div>[  P.S. Is the an ETA for the next AS release ?  ] </div><div><br></div><br><blockquote type="cite"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 12, 2014 at 4:24 PM, Steven Majewski <span dir="ltr"><<a href="mailto:sdm7g@virginia.edu" target="_blank">sdm7g@virginia.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><br></div><div>I know I can transfer a resource from one repository to another on the same server. </div><div>I there a way to easily move a resource from one ArchivesSpace server instance to another ? </div><div><br></div><div>I know I can export to EAD and reload that again, but we’ve been having enough problems with</div><div>EAD import and export that I’ld rather not do it this way. </div><div><br></div><div>I tried what I thought was the obvious API method: </div><div><br></div><div><br></div><div><font face="Courier">./curl_as_osx admin [pwd] -O <a href="http://archives-test.lib.virginia.edu:8089/repositories/9/resources/3964" target="_blank">http://archives-test.lib.virginia.edu:8089/repositories/9/resources/3964</a> </font></div><div><font face="Courier"><br></font></div><div><font face="Courier">./curl_as_osx admin [pwd] -d @3964  <a href="http://localhost:8089/repositories/2/batch_imports" target="_blank">http://localhost:8089/repositories/2/batch_imports</a></font></div><div><font face="Courier"><br></font></div><div>But I get this error: </div><div><br></div><div><font face="Courier">[<br>{"status":[{"id":1,"label":"Reading JSON records","type":"started"},{"id":1,"label":"Reading JSON records","type":"done"},{"id":2,"label":"Validating records and checking links","type":"started"}]},<br>{"saved":[],"errors":["Server error: Can not deserialize instance of java.util.LinkedHashMap out of VALUE_STRING token\n at [Source: java.io.FileReader@51d866d9; line: 1, column: 1]"]}<br><br>]</font></div><div><br></div><div><div><br></div><div>Is that something that should theoretically work ? Or am I trying to feed it the wrong JSON schema ? </div><div><br></div><div>I only want to move selected records, so a database dump is not a simple way to do it either. </div></div><div><br></div><div>Are there any other migration tools to help with this problem ? </div><div><br></div><div><br></div><div><br></div><div><br></div><div>— Steve Majewski / UVA Alderman Library</div><div><br></div><div><br></div></div><br>_______________________________________________<br>
Archivesspace_Users_Group mailing list<br>
<a href="mailto:Archivesspace_Users_Group@lyralists.lyrasis.org">Archivesspace_Users_Group@lyralists.lyrasis.org</a><br>
<a href="http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group" target="_blank">http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Nathan Stevens<br>Programmer/Analyst<br>Digital Library Technology Services<br>New York University<br><br>1212-998-2653<br><a href="mailto:ns96@nyu.edu" target="_blank">ns96@nyu.edu</a>
</div>
_______________________________________________<br>Archivesspace_Users_Group mailing list<br><a href="mailto:Archivesspace_Users_Group@lyralists.lyrasis.org">Archivesspace_Users_Group@lyralists.lyrasis.org</a><br>http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group<br></blockquote></div><br></body></html>