You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Hans-Peter Stoerr (Jira)" <ji...@apache.org> on 2022/03/18 18:43:00 UTC

[jira] [Created] (OAK-9728) Oak-Migrate: --copy-orphaned-versions does not work when version storage exists

Hans-Peter Stoerr created OAK-9728:
--------------------------------------

             Summary: Oak-Migrate: --copy-orphaned-versions does not work when version storage exists
                 Key: OAK-9728
                 URL: https://issues.apache.org/jira/browse/OAK-9728
             Project: Jackrabbit Oak
          Issue Type: Bug
          Components: upgrade
    Affects Versions: 1.42.0
            Reporter: Hans-Peter Stoerr


I attempted to copy content from an old repository to a new repository with [oak-upgrade|https://jackrabbit.apache.org/oak/docs/migration.html] while using --copy-orphaned-versions . Due to an old bugfix https://issues.apache.org/jira/browse/OAK-5112 it turns out that this does not actually copy these: when the new repository already contains a version storage, the orphaned versions are not copied: see [this line in RepositorySidegrade|https://github.com/apache/jackrabbit-oak/blob/383264174181e7be751214bbca669996fd1f6b73/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositorySidegrade.java#L284].  There is a log message "The version storage on destination already exists. Orphaned version histories will be skipped.".

I'm reporting this as a bug since that is [not consistent with the documentation|https://jackrabbit.apache.org/oak/docs/migration.html].

By the way: the orphaned versions we need copied are orphaned in the sense that there aren't any checked out mix:versionables for them anymore. But they are actually strongly referenced through a property of type  [javax.jcr.PropertyType.REFERENCE|https://developer.adobe.com/experience-manager/reference-materials/spec/jsr170/javadocs/jcr-1.0/javax/jcr/PropertyType.html#REFERENCE]. So, not copying these version histories does actually lead to an inconsistent JCR repository. Thus, there is a good case to be made that these should be copied even in the absence of --copy-orphaned-versions. So, one way to solve is to just document this behaviour, but fix the problem that versions referenced through other means than existing versionables would also be copied. (In a way that'd even help us, since that'd copy only what's actually used.)



--
This message was sent by Atlassian Jira
(v8.20.1#820001)