You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Paco Avila <pa...@git.es> on 2008/03/11 11:58:03 UTC

Can I export / import version history?

I've posted this message a week ago and nobody tell anything about it. 

What can I do if i need to change my node type configuration and want to
preserve the node version history?

I can't belibe nobody have this problem!
-- 
Paco Avila <pa...@git.es>
GIT Consultors


Re: Can I export / import version history?

Posted by Paco Avila <pa...@git.es>.
El mar, 11-03-2008 a las 13:07 +0200, Jukka Zitting escribió:
> Hi,
> 
> On Tue, Mar 11, 2008 at 12:58 PM, Paco Avila <pa...@git.es> wrote:
> > I've posted this message a week ago and nobody tell anything about it.
> >
> >  What can I do if i need to change my node type configuration and want to
> >  preserve the node version history?
> 
> The easiest way to achieve that at the moment is probably to update
> the namespace of the node types in question so you can keep both the
> old and the new types in the same repository and migrate the content
> incrementally without an export/import operation.

So, I will have an "old namespace" definition and a new one? This
implies a lot of changes in my source code.

> There's been a number of attempts to solve the export/import issue for
> the version store, but so far none of the solutions have really been
> merged to Jackrabbit. The best practice for backing up and restoring
> the entire repository is currently to use lower database and file
> system level backup tools, but of course such solutions don't really
> help with migration tasks where you want to modify the content instead
> of just restoring it.

I've benn trying to export / import "/jcr:system/jcr:versionStorage"
with no results. And I don't know why can't be done. This should be a
very practical enhancement.

> This is one of the areas where contributions would be very much welcome.

I've working on it iterating over a node version history in the old
repository and replicating it in the new one. This process also add /
replace the modified node properties. The problem is that I cannot
change the "jcr:created" property because is proptected.

So I disabled "definition.isProtected()" check in "protected void
checkSetValue(boolean multipleValues)" from
org.apache.jackrabbit.core.PropertyImpl.java but the changes don't seem
to be persisted.

Very weird behaviour :/

-- 
Paco Avila <pa...@git.es>
GIT Consultors


Re: Can I export / import version history?

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

On Tue, Mar 11, 2008 at 12:58 PM, Paco Avila <pa...@git.es> wrote:
> I've posted this message a week ago and nobody tell anything about it.
>
>  What can I do if i need to change my node type configuration and want to
>  preserve the node version history?

The easiest way to achieve that at the moment is probably to update
the namespace of the node types in question so you can keep both the
old and the new types in the same repository and migrate the content
incrementally without an export/import operation.

There's been a number of attempts to solve the export/import issue for
the version store, but so far none of the solutions have really been
merged to Jackrabbit. The best practice for backing up and restoring
the entire repository is currently to use lower database and file
system level backup tools, but of course such solutions don't really
help with migration tasks where you want to modify the content instead
of just restoring it.

This is one of the areas where contributions would be very much welcome.

BR,

Jukka Zitting

Re: Can I export / import version history?

Posted by David Nuescheler <da...@day.com>.
hi paco,

>  > i think the version history is not affected if you make changes
>  > to your node types.
>  This is not always true. I'have added an "user comment" property to the
>  versioned node, so the applications expect to see this property in the
>  versioned nodes. The old repository do no have this property, so will
>  fail with the actual modification.
well, generally i think it is important to distinguish between "versions"
and "versionable nodes". if we are talking about old "versions" of the
node then these are considered immutable in the repository. this is
an important design principle and thats why the concept of a frozen
node what introduced in jcr. so an application should be able to
deal with the fact that over the course of a version history the nodetype
definition may have changed, hence the "frozen node".

>  > generally the version store is implemented as a workspace so you can
>  > just copy the version store on to your new repository, but you need
>  > to make sure that the uuid's (and version property) of the nodes in
>  > your workspace(s) are preserved so they match the uuid's in the
>  > version store. i would probably use a system view export to make
>  > sure of that.
>  > does that work for you?
>  I've benn trying to export / import "/jcr:system/jcr:versionStorage"
>  with no results :(
that's not what i meant. you can copy the underlying version store
on an fs or rdbms level, but as far as i understand you would like
to export, modify and then re-import the version store.

as far as i am concerned due to the immutable nature of versions
i think this is probably not even a sustainable use case that we would
like to cover in jcr.

as mentioned above, the concept of the frozen node has exactly been
introduce to accomodate nodetype changes without having to modify
the version store.

regards,
david

Re: Can I export / import version history?

Posted by Paco Avila <pa...@git.es>.

El mar, 11-03-2008 a las 12:07 +0100, David Nuescheler escribió:
> hi paco,
> 
> i think the version history is not affected if you make changes
> to your node types.

This is not always true. I'have added an "user comment" property to the
versioned node, so the applications expect to see this property in the
versioned nodes. The old repository do no have this property, so will
fail with the actual modification.

> generally the version store is implemented as a workspace so you can
> just copy the version store on to your new repository, but you need
> to make sure that the uuid's (and version property) of the nodes in
> your workspace(s) are preserved so they match the uuid's in the
> version store. i would probably use a system view export to make
> sure of that.
> 
> does that work for you?

I've benn trying to export / import "/jcr:system/jcr:versionStorage"
with no results :(

> 
> regards,
> david
> 
> On Tue, Mar 11, 2008 at 11:58 AM, Paco Avila <pa...@git.es> wrote:
> > I've posted this message a week ago and nobody tell anything about it.
> >
> >  What can I do if i need to change my node type configuration and want to
> >  preserve the node version history?
> >
> >  I can't belibe nobody have this problem!
> >  --
> >  Paco Avila <pa...@git.es>
> >  GIT Consultors
> >
> >
-- 
Paco Avila <pa...@git.es>
GIT Consultors


Re: Can I export / import version history?

Posted by David Nuescheler <da...@day.com>.
hi paco,

i think the version history is not affected if you make changes
to your node types.

generally the version store is implemented as a workspace so you can
just copy the version store on to your new repository, but you need
to make sure that the uuid's (and version property) of the nodes in
your workspace(s) are preserved so they match the uuid's in the
version store. i would probably use a system view export to make
sure of that.

does that work for you?

regards,
david

On Tue, Mar 11, 2008 at 11:58 AM, Paco Avila <pa...@git.es> wrote:
> I've posted this message a week ago and nobody tell anything about it.
>
>  What can I do if i need to change my node type configuration and want to
>  preserve the node version history?
>
>  I can't belibe nobody have this problem!
>  --
>  Paco Avila <pa...@git.es>
>  GIT Consultors
>
>