7 Replies Latest reply on Jun 15, 2016 4:00 PM by reggie.yu

    Maintaining version history "created" timestamps when importing

    corey.schooler

      My team is currently in the process of migrating from Jackrabbit 1 to Modeshape.  We would like to maintain the version history from our out existing repository.   It appears that although the "created" properties are available in the Jackrabbit export, Modeshape does not persist this value and instead writes the current instant for the "created" value.  Is this the desired behavior?  Is there a way to get Modeshape to honor the values from the exported repository?

        • 1. Re: Maintaining version history "created" timestamps when importing
          hchiorean

          ModeShape does not support importing anything under the /jcr:system branch (from a system document), so this information cannot be migrated unfortunately.

          • 2. Re: Maintaining version history "created" timestamps when importing
            corey.schooler

            In my Modeshape instance, I see to see the following version information.

             

            Printed section of the modeshape tree:

                                /jcr:system/jcr:versionStorage/b7/6b
                                6b
                                     /jcr:system/jcr:versionStorage/b7/6b/a1
                                     a1
                                          /jcr:system/jcr:versionStorage/b7/6b/a1/b76ba1955d1340e70617625d22a96022e66f73bb
                                          b76ba1955d1340e70617625d22a96022e66f73bb
                                               /jcr:system/jcr:versionStorage/b7/6b/a1/b76ba1955d1340e70617625d22a96022e66f73bb/jcr:rootVersion
                                               jcr:rootVersion
                                                    /jcr:system/jcr:versionStorage/b7/6b/a1/b76ba1955d1340e70617625d22a96022e66f73bb/jcr:rootVersion/jcr:frozenNode
                                                    jcr:frozenNode
                                                         jcr:frozenMixinTypes: mix:versionable
                                                         jcr:frozenPrimaryType: nt:unstructured
                                                         jcr:frozenUuid: 15b89cf2-b248-4b60-bae2-eddb51e4ccb6
                                                         jcr:primaryType: nt:frozenNode
                                                         jcr:uuid: e60d4aa317f1e7d279714a-64d1-412a-8d6b-67a34a5b3579
                                                    jcr:created: 2016-06-13T16:52:42.924-05:00
                                                    jcr:primaryType: nt:version
                                                    jcr:uuid: b9430a05-4228-4de6-9820-115405c40782
                                               /jcr:system/jcr:versionStorage/b7/6b/a1/b76ba1955d1340e70617625d22a96022e66f73bb/jcr:versionLabels
                                               jcr:versionLabels
                                                    jcr:primaryType: nt:versionLabels
                                               jcr:primaryType: nt:versionHistory
                                               jcr:uuid: 15b89cf2-b248-4b60-bae2-eddb51e4ccb6
                                               jcr:versionableUuid: 15b89cf2-b248-4b60-bae2-eddb51e4ccb6
                                          jcr:primaryType: mode:versionHistoryFolder
                                     jcr:primaryType: mode:versionHistoryFolder
            

             

            Is not related to the import here:

                                <sv:node sv:name="9c">
                                    <sv:property sv:name="jcr:primaryType" sv:type="Name">
                                        <sv:value>rep:versionStorage</sv:value>
                                    </sv:property>
                                    <sv:node sv:name="15b89cf2-b248-4b60-bae2-eddb51e4ccb6">
                                        <sv:property sv:name="jcr:primaryType" sv:type="Name">
                                            <sv:value>nt:versionHistory</sv:value>
                                        </sv:property>
                                        <sv:property sv:name="jcr:uuid" sv:type="String">
                                            <sv:value>d1295184-f60a-419f-ba1f-3e9632757ee2</sv:value>
                                        </sv:property>
                                        <sv:property sv:name="jcr:versionableUuid" sv:type="String">
                                            <sv:value>15b89cf2-b248-4b60-bae2-eddb51e4ccb6</sv:value>
                                        </sv:property>
                                        <sv:node sv:name="jcr:versionLabels">
                                            <sv:property sv:name="jcr:primaryType" sv:type="Name">
                                                <sv:value>nt:versionLabels</sv:value>
                                            </sv:property>
                                        </sv:node>
                                        <sv:node sv:name="jcr:rootVersion">
                                            <sv:property sv:name="jcr:primaryType" sv:type="Name">
                                                <sv:value>nt:version</sv:value>
                                            </sv:property>
                                            <sv:property sv:name="jcr:uuid" sv:type="String">
                                                <sv:value>01b78452-682b-4800-a061-f9727931c0b3</sv:value>
                                            </sv:property>
                                            <sv:property sv:name="jcr:created" sv:type="Date">
                                                <sv:value>2016-06-13T09:28:41.668-05:00</sv:value>
                                            </sv:property>
                                            <sv:property sv:name="jcr:predecessors" sv:type="Reference"/>
                                            <sv:property sv:name="jcr:successors" sv:type="Reference">
                                                <sv:value>2c0a2aae-1d07-415d-9ada-4ec144464693</sv:value>
                                            </sv:property>
                                            <sv:node sv:name="jcr:frozenNode">
                                                <sv:property sv:name="jcr:primaryType" sv:type="Name">
                                                    <sv:value>nt:frozenNode</sv:value>
                                                </sv:property>
                                                <sv:property sv:name="jcr:uuid" sv:type="String">
                                                    <sv:value>bb27d1fd-61bf-416d-b576-c585a79a9590</sv:value>
                                                </sv:property>
                                                <sv:property sv:name="jcr:frozenMixinTypes" sv:type="Name">
                                                    <sv:value>mix:versionable</sv:value>
                                                </sv:property>
                                                <sv:property sv:name="jcr:frozenPrimaryType" sv:type="Name">
                                                    <sv:value>nt:unstructured</sv:value>
                                                </sv:property>
                                                <sv:property sv:name="jcr:frozenUuid" sv:type="String">
                                                    <sv:value>15b89cf2-b248-4b60-bae2-eddb51e4ccb6</sv:value>
                                                </sv:property>
                                            </sv:node>
                                        </sv:node>
                                        <sv:node sv:name="1.0">
                                            <sv:property sv:name="jcr:primaryType" sv:type="Name">
                                                <sv:value>nt:version</sv:value>
                                            </sv:property>
                                            <sv:property sv:name="jcr:uuid" sv:type="String">
                                                <sv:value>2c0a2aae-1d07-415d-9ada-4ec144464693</sv:value>
                                            </sv:property>
                                            <sv:property sv:name="jcr:created" sv:type="Date">
                                                <sv:value>2016-06-13T09:28:41.826-05:00</sv:value>
                                            </sv:property>
                                            <sv:property sv:name="jcr:predecessors" sv:type="Reference">
                                                <sv:value>01b78452-682b-4800-a061-f9727931c0b3</sv:value>
                                            </sv:property>
                                            <sv:property sv:name="jcr:successors" sv:type="Reference"/>
                                            <sv:node sv:name="jcr:frozenNode">
                                                <sv:property sv:name="jcr:primaryType" sv:type="Name">
                                                    <sv:value>nt:frozenNode</sv:value>
                                                </sv:property>
                                                <sv:property sv:name="jcr:uuid" sv:type="String">
                                                    <sv:value>deac6be7-c76e-4a3a-959d-76ad19e70bbe</sv:value>
                                                </sv:property>
                                                <sv:property sv:name="jcr:frozenMixinTypes" sv:type="Name">
                                                    <sv:value>mix:versionable</sv:value>
                                                </sv:property>
                                                <sv:property sv:name="jcr:frozenPrimaryType" sv:type="Name">
                                                    <sv:value>nt:unstructured</sv:value>
                                                </sv:property>
                                                <sv:property sv:name="jcr:frozenUuid" sv:type="String">
                                                    <sv:value>15b89cf2-b248-4b60-bae2-eddb51e4ccb6</sv:value>
                                                </sv:property>
                                                <sv:property sv:name="jcr:predecessors" sv:type="Reference">
                                                    <sv:value>01b78452-682b-4800-a061-f9727931c0b3</sv:value>
                                                </sv:property>
                                                <sv:property sv:name="jcr:versionHistory" sv:type="Reference">
                                                    <sv:value>d1295184-f60a-419f-ba1f-3e9632757ee2</sv:value>
                                                </sv:property>
                                            </sv:node>
                                        </sv:node>
                                    </sv:node>
                                </sv:node>
            

             

            The tree output above is related only to the history from the newly created node in Modeshape and is not related to the history imported from Jackrabbit?

            • 3. Re: Maintaining version history "created" timestamps when importing
              hchiorean

              The tree output above is related only to the history from the newly created node in Modeshape and is not related to the history imported from Jackrabbit?

              that is correct. ModeShape ignores everything under the /jcr:system area when importing system-view exports. You can see a discussion as to why we're not doing this on this issue for example: [MODE-1864] Be able to import/export versionable node with its version history - JBoss Issue Tracker

              • 4. Re: Maintaining version history "created" timestamps when importing
                corey.schooler

                Thanks for the clarification.

                • 5. Re: Maintaining version history "created" timestamps when importing
                  reggie.yu

                  I've read MODE-1864, and this particular comment seems to imply that ModeShape's backup and restore functionality will preserve version history data.

                  Can the restore functionality be used to "import" versioned nodes and their history into a blank ModeShape repository?

                  (assuming that the Jackrabbit data was exported into a format that is readable by ModeShape's restore functionality)

                  • 6. Re: Maintaining version history "created" timestamps when importing
                    hchiorean

                    Backup & restore (Backup and restore - ModeShape 5 - Project Documentation Editor) are a ModeShape-specific feature meant to allow migration between major versions of ModeShape, where the persistent storage format might have changed. This is not related in any way to JCR's import/export feature and document/system view. And yes, when doing a ModeShape backup/restore the entire repository data (including system content) is restored.

                     

                    To answer your question, if someone were to export Jackrabbit data as the JSON documents which ModeShape's restore expects, then yes, you could "restore" JR data into ModeShape. But I'm not aware of such functionality existing out there atm.

                    • 7. Re: Maintaining version history "created" timestamps when importing
                      reggie.yu

                      Thanks for the response, that answers my questions!