You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by KÖLL Claus <C....@TIROL.GV.AT> on 2007/04/24 09:57:20 UTC

Migrate from Old OraclePersistenceManager to new Bundle OraclePersistenceManager

As i see in the oracle.ddl file from the new bundle persistence managers it will create a new table (BUNDLE)
What do i have to do to migrate a old workspace ?

BR,
claus

Re: Migrate from Old OraclePersistenceManager to new Bundle OraclePersistenceManager

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

On 4/25/07, Martijn Hendriks <ma...@gx.nl> wrote:
> We have built a small command-line tool for JCR import and export. This
> tool can also be used for the described upgrade problem. We are happy to
> contribute it to the Apache Jackrabbit project if there's interest in it.
> If so, how can we do this?

Excellent, such a tool would be very much welcome!

Assuming the tool is reasonably small you can just file a feature
request in Jira and attach the code there. The required amount of
paperwork depends on the amount of code you're contributing, here's a
rough guideline:

a) small; a single class:
   just select the "Grant license to ASF" option in the attach form on Jira

b) medium; a package with a few classes:
   a CLA (and a CCLA for companies) would be appreciated

c) large; many classes in multiple packages:
   a software grant is needed

See http://www.apache.org/licenses/#clas for more details.

BR,

Jukka Zitting

AW: Migrate from Old OraclePersistenceManager to new Bundle OraclePersistenceManager

Posted by KÖLL Claus <C....@TIROL.GV.AT>.
hi martjin,

that sounds good !
i hope somebody ..jukka ;-) will explain you how you can contribute it to jackrabbit ..

BR
claus

-----Ursprüngliche Nachricht-----
Von: Martijn Hendriks [mailto:martijnh@gx.nl] 
Gesendet: Mittwoch, 25. April 2007 16:56
An: dev@jackrabbit.apache.org
Betreff: RE: Migrate from Old OraclePersistenceManager to new Bundle OraclePersistenceManager

Hi,

We have built a small command-line tool for JCR import and export. This tool can also be used for the described upgrade problem. We are happy to contribute it to the Apache Jackrabbit project if there's interest in it. If so, how can we do this?

Regards,

Martijn Hendriks
<GX> creative online development B.V.
 
t: 024 - 3888 261
f: 024 - 3888 621
e: martijnh@gx.nl
 
Wijchenseweg 111
6538 SW Nijmegen
http://www.gx.nl/  

> -----Original Message-----
> From: Jukka Zitting [mailto:jukka.zitting@gmail.com] 
> Sent: Tuesday, April 24, 2007 10:06 AM
> To: dev@jackrabbit.apache.org
> Subject: Re: Migrate from Old OraclePersistenceManager to new 
> Bundle OraclePersistenceManager
> 
> Hi,
> 
> On 4/24/07, KÖLL Claus <C....@tirol.gv.at> wrote:
> > As i see in the oracle.ddl file from the new bundle persistence 
> > managers it will create a new table (BUNDLE) What do i have 
> to do to migrate a old workspace?
> 
> I would create a new workspace with the bundle configuration and use
> Workspace.clone() to copy all content to the new workspace.
> 
> As of now we don't have any migration tools that would take 
> an existing db persistence database and upgrade it to use 
> bundle persistence. Writing such a utility shouldn't be too 
> hard though, so perhaps someone will contribute it...
> 
> BR,
> 
> Jukka Zitting
> 

RE: Migrate from Old OraclePersistenceManager to new Bundle OraclePersistenceManager

Posted by Martijn Hendriks <ma...@gx.nl>.
Hi,

We have built a small command-line tool for JCR import and export. This tool can also be used for the described upgrade problem. We are happy to contribute it to the Apache Jackrabbit project if there's interest in it. If so, how can we do this?

Regards,

Martijn Hendriks
<GX> creative online development B.V.
 
t: 024 - 3888 261
f: 024 - 3888 621
e: martijnh@gx.nl
 
Wijchenseweg 111
6538 SW Nijmegen
http://www.gx.nl/  

> -----Original Message-----
> From: Jukka Zitting [mailto:jukka.zitting@gmail.com] 
> Sent: Tuesday, April 24, 2007 10:06 AM
> To: dev@jackrabbit.apache.org
> Subject: Re: Migrate from Old OraclePersistenceManager to new 
> Bundle OraclePersistenceManager
> 
> Hi,
> 
> On 4/24/07, KÖLL Claus <C....@tirol.gv.at> wrote:
> > As i see in the oracle.ddl file from the new bundle persistence 
> > managers it will create a new table (BUNDLE) What do i have 
> to do to migrate a old workspace?
> 
> I would create a new workspace with the bundle configuration and use
> Workspace.clone() to copy all content to the new workspace.
> 
> As of now we don't have any migration tools that would take 
> an existing db persistence database and upgrade it to use 
> bundle persistence. Writing such a utility shouldn't be too 
> hard though, so perhaps someone will contribute it...
> 
> BR,
> 
> Jukka Zitting
> 

Re: Migrate from Old OraclePersistenceManager to new Bundle OraclePersistenceManager

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

On 4/24/07, KÖLL Claus <C....@tirol.gv.at> wrote:
> One question to workspace.clone ..
> will be the uuids generated again or will they been taken from the source workspace?

Workspace.clone() preserves UUIDs, see the API javadocs for the details.

BR,

Jukka Zitting

AW: Migrate from Old OraclePersistenceManager to new Bundle OraclePersistenceManager

Posted by KÖLL Claus <C....@TIROL.GV.AT>.
One question to workspace.clone ..
will be the uuids generated again or will they been taken from the source workspace?

thanks
claus

-----Ursprüngliche Nachricht-----
Von: KÖLL Claus [mailto:C.KOELL@TIROL.GV.AT] 
Gesendet: Dienstag, 24. April 2007 10:12
An: dev@jackrabbit.apache.org
Betreff: AW: Migrate from Old OraclePersistenceManager to new Bundle OraclePersistenceManager

hi jukka,
thanks for the info.

i hope someone contribute such a migration util ...

BR,
claus

-----Ursprüngliche Nachricht-----
Von: Jukka Zitting [mailto:jukka.zitting@gmail.com] 
Gesendet: Dienstag, 24. April 2007 10:06
An: dev@jackrabbit.apache.org
Betreff: Re: Migrate from Old OraclePersistenceManager to new Bundle OraclePersistenceManager

Hi,

On 4/24/07, KÖLL Claus <C....@tirol.gv.at> wrote:
> As i see in the oracle.ddl file from the new bundle persistence managers it will
> create a new table (BUNDLE) What do i have to do to migrate a old workspace?

I would create a new workspace with the bundle configuration and use
Workspace.clone() to copy all content to the new workspace.

As of now we don't have any migration tools that would take an
existing db persistence database and upgrade it to use bundle
persistence. Writing such a utility shouldn't be too hard though, so
perhaps someone will contribute it...

BR,

Jukka Zitting

AW: Migrate from Old OraclePersistenceManager to new Bundle OraclePersistenceManager

Posted by KÖLL Claus <C....@TIROL.GV.AT>.
hi jukka,
thanks for the info.

i hope someone contribute such a migration util ...

BR,
claus

-----Ursprüngliche Nachricht-----
Von: Jukka Zitting [mailto:jukka.zitting@gmail.com] 
Gesendet: Dienstag, 24. April 2007 10:06
An: dev@jackrabbit.apache.org
Betreff: Re: Migrate from Old OraclePersistenceManager to new Bundle OraclePersistenceManager

Hi,

On 4/24/07, KÖLL Claus <C....@tirol.gv.at> wrote:
> As i see in the oracle.ddl file from the new bundle persistence managers it will
> create a new table (BUNDLE) What do i have to do to migrate a old workspace?

I would create a new workspace with the bundle configuration and use
Workspace.clone() to copy all content to the new workspace.

As of now we don't have any migration tools that would take an
existing db persistence database and upgrade it to use bundle
persistence. Writing such a utility shouldn't be too hard though, so
perhaps someone will contribute it...

BR,

Jukka Zitting

Re: Migrate from Old OraclePersistenceManager to new Bundle OraclePersistenceManager

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

On 4/24/07, Christoph Kiehl <ch...@sulu3000.de> wrote:
> Christoph Kiehl wrote:
> > I tried the following:
> >
> > testWorkspace.clone("default", "/" , "/" , false);
>
> My second try was to just clone one of our root nodes:
>
> testWorkspace.clone("default", "/content" , "/content" , false);

The target path of the clone() method is defined as the "absolute path
to the parent node of the new location, appended with the new name
desired for the cloned node", so using just "/" doesn't work.

> This failed because of the following exception:
>
> Caused by: javax.jcr.ReferentialIntegrityException: Target node
> c83ca884-4ad4-40a3-a6da-0fb5b8c33608 of REFERENCE property does not exist

You probably have more than one subtree below the root node and
references across these subtrees. When you clone() just a single
subtree at a time the references get broken.

> Is there any way to clone a whole workspace? Without referential integrity
> problems?

My usual recommendation is to use a separate "application root" node
like "/my:content" under which you put all the content in your
application. This way you can clone the entire application in one
piece without the reference issues.

You could do that just for the migration by 1) creating such a
application root node, 2) moving all other subtrees below that node,
3) cloning the entire tree to a new workspace, and 4) moving the
subtrees back to the root of the new workspace.

> Apparently clone() seems to copy the whole content into memory before
> saving it to the destination workspace. Is that true?

Yes, unfortunately. Given the current ChangeLog implementation,
Jackrabbit keeps all changesets in memory regardless of whether they
go through the transient space or not.

BR,

Jukka Zitting

AW: Re: Migrate from Old OraclePersistenceManager to new Bundle OraclePersistenceManager

Posted by KÖLL Claus <C....@TIROL.GV.AT>.
hi christoph,

i have the same problem.
can anybody please give us a hint ?

thanks
BR,
claus

-----Ursprüngliche Nachricht-----
Von: news [mailto:news@sea.gmane.org] Im Auftrag von Christoph Kiehl
Gesendet: Dienstag, 24. April 2007 19:40
An: dev@jackrabbit.apache.org
Betreff: Re: Migrate from Old OraclePersistenceManager to new Bundle OraclePersistenceManager

Christoph Kiehl wrote:

> I tried the following:
> 
> testWorkspace.clone("default", "/" , "/" , false);

My second try was to just clone one of our root nodes:

testWorkspace.clone("default", "/content" , "/content" , false);

This failed because of the following exception:

Caused by: javax.jcr.ReferentialIntegrityException: Target node 
c83ca884-4ad4-40a3-a6da-0fb5b8c33608 of REFERENCE property does not exist
	at 
org.apache.jackrabbit.core.state.SharedItemStateManager.checkReferentialIntegrity(SharedItemStateManager.java:1418)
	at 
org.apache.jackrabbit.core.state.SharedItemStateManager$Update.begin(SharedItemStateManager.java:556)
	at 
org.apache.jackrabbit.core.state.SharedItemStateManager.beginUpdate(SharedItemStateManager.java:825)
	at 
org.apache.jackrabbit.core.state.SharedItemStateManager.update(SharedItemStateManager.java:855)
	at 
org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:326)
	at 
org.apache.jackrabbit.core.state.XAItemStateManager.update(XAItemStateManager.java:313)
	at 
org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:302)
	at 
org.apache.jackrabbit.core.BatchedItemOperations.update(BatchedItemOperations.java:182)
	at org.apache.jackrabbit.core.WorkspaceImpl.internalCopy(WorkspaceImpl.java:300)
	at org.apache.jackrabbit.core.WorkspaceImpl.clone(WorkspaceImpl.java:403)


Is there any way to clone a whole workspace? Without referential integrity 
problems? Apparently clone() seems to copy the whole content into memory before 
saving it to the destination workspace. Is that true?

Regards,
Christoph


Re: Migrate from Old OraclePersistenceManager to new Bundle OraclePersistenceManager

Posted by Christoph Kiehl <ch...@sulu3000.de>.
Christoph Kiehl wrote:

> I tried the following:
> 
> testWorkspace.clone("default", "/" , "/" , false);

My second try was to just clone one of our root nodes:

testWorkspace.clone("default", "/content" , "/content" , false);

This failed because of the following exception:

Caused by: javax.jcr.ReferentialIntegrityException: Target node 
c83ca884-4ad4-40a3-a6da-0fb5b8c33608 of REFERENCE property does not exist
	at 
org.apache.jackrabbit.core.state.SharedItemStateManager.checkReferentialIntegrity(SharedItemStateManager.java:1418)
	at 
org.apache.jackrabbit.core.state.SharedItemStateManager$Update.begin(SharedItemStateManager.java:556)
	at 
org.apache.jackrabbit.core.state.SharedItemStateManager.beginUpdate(SharedItemStateManager.java:825)
	at 
org.apache.jackrabbit.core.state.SharedItemStateManager.update(SharedItemStateManager.java:855)
	at 
org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:326)
	at 
org.apache.jackrabbit.core.state.XAItemStateManager.update(XAItemStateManager.java:313)
	at 
org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:302)
	at 
org.apache.jackrabbit.core.BatchedItemOperations.update(BatchedItemOperations.java:182)
	at org.apache.jackrabbit.core.WorkspaceImpl.internalCopy(WorkspaceImpl.java:300)
	at org.apache.jackrabbit.core.WorkspaceImpl.clone(WorkspaceImpl.java:403)


Is there any way to clone a whole workspace? Without referential integrity 
problems? Apparently clone() seems to copy the whole content into memory before 
saving it to the destination workspace. Is that true?

Regards,
Christoph


Re: Migrate from Old OraclePersistenceManager to new Bundle OraclePersistenceManager

Posted by Christoph Kiehl <ch...@sulu3000.de>.
Jukka Zitting wrote:

>> As i see in the oracle.ddl file from the new bundle persistence 
>> managers it will
>> create a new table (BUNDLE) What do i have to do to migrate a old 
>> workspace?
> 
> I would create a new workspace with the bundle configuration and use
> Workspace.clone() to copy all content to the new workspace.

That sounded like a nice migration path, but unfortunately I was unable to clone 
my workspace.

I tried the following:

testWorkspace.clone("default", "/" , "/" , false);

and got this exception:

javax.jcr.PathNotFoundException: no such ancestor path of degree 1
    at org.apache.jackrabbit.name.Path.getAncestor(Path.java:520)
    at 
org.apache.jackrabbit.core.BatchedItemOperations.copy(BatchedItemOperations.java:276)
    at org.apache.jackrabbit.core.WorkspaceImpl.internalCopy(WorkspaceImpl.java:296)
    at org.apache.jackrabbit.core.WorkspaceImpl.clone(WorkspaceImpl.java:403)
    at com.subshell.sophora.server.SophoraServer.start(SophoraServer.java:197)
    at com.subshell.sophora.server.SophoraServer.main(SophoraServer.java:92)

Any idea what I should do to clone a whole workspace?

Cheers,
Christoph


Re: Migrate from Old OraclePersistenceManager to new Bundle OraclePersistenceManager

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

On 4/24/07, KÖLL Claus <C....@tirol.gv.at> wrote:
> As i see in the oracle.ddl file from the new bundle persistence managers it will
> create a new table (BUNDLE) What do i have to do to migrate a old workspace?

I would create a new workspace with the bundle configuration and use
Workspace.clone() to copy all content to the new workspace.

As of now we don't have any migration tools that would take an
existing db persistence database and upgrade it to use bundle
persistence. Writing such a utility shouldn't be too hard though, so
perhaps someone will contribute it...

BR,

Jukka Zitting