You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Omid Milani <om...@gmail.com> on 2010/10/13 04:07:42 UTC

How to get a copy of repository?

Hi,

I was trying to get a copy of a workspace into another repository with
different persistence manager. I expected to be straightforward, but
it proved extensively troubling.

First I exported system view of jcr:root, but it wouldn't import
because of jcr:system node. Then, I exported only subtree of my data,
this time it began importing but both session.importXML &
workspace.importXML throw out of memory exception - with 500 MB of
exported xml and 1024 MB heap.

Finally I wrote an script to export the data in small chunks, and
could get them imported, but this time multi-valued properties with
only one value in them were imported as single-value, and when my
application tried to read them as multi-value it throw an exception,
so I had to write another script to change them to mult-value. As I
look into system-view xml file, there's no mention of properties being
multi-valued, so when there's only on value importer isn't able to
detect the difference with single-value ones.

So my question is, is these the expected behavior of export & import?
And is there a better way of getting a copy of repository? Is it
possible to use journal like what cluster nodes do but into another
repository? (This can't be done manually as then the UUIDs and
references would be lost)

Omid,

Re: How to get a copy of repository?

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Wed, Oct 13, 2010 at 4:07 AM, Omid Milani <om...@gmail.com> wrote:
> And is there a better way of getting a copy of repository?

See http://jackrabbit.apache.org/standalone-server.html#StandaloneServer-Backupandmigration

BR,

Jukka Zitting

Re: How to get a copy of repository?

Posted by Rakesh Vidyadharan <ra...@sptci.com>.
On 12 Oct 2010, at 21:07, Omid Milani wrote:

> Hi,
> 
> I was trying to get a copy of a workspace into another repository with
> different persistence manager. I expected to be straightforward, but
> it proved extensively troubling.
> 
> First I exported system view of jcr:root, but it wouldn't import
> because of jcr:system node. Then, I exported only subtree of my data,
> this time it began importing but both session.importXML &
> workspace.importXML throw out of memory exception - with 500 MB of
> exported xml and 1024 MB heap.
> 
> Finally I wrote an script to export the data in small chunks, and
> could get them imported, but this time multi-valued properties with
> only one value in them were imported as single-value, and when my
> application tried to read them as multi-value it throw an exception,
> so I had to write another script to change them to mult-value. As I
> look into system-view xml file, there's no mention of properties being
> multi-valued, so when there's only on value importer isn't able to
> detect the difference with single-value ones.
> 
> So my question is, is these the expected behavior of export & import?
> And is there a better way of getting a copy of repository? Is it
> possible to use journal like what cluster nodes do but into another
> repository? (This can't be done manually as then the UUIDs and
> references would be lost)
> 
> Omid,

I had asked the same question w.r.t multi-valued properties not being preserved, and the response was that JCR 2.0 would cover that scenario.  I have not tried it yet with JR 2.x, since we are still on 1.6.x.  I changed my accessor code to always check to see if the property is multi-valued or not.  Regarding memory for single export, I need around 2.5 Gb of heap space for a 140 Mb export file.

Rakesh