1 2 Previous Next 16 Replies Latest reply on Mar 19, 2015 11:35 AM by mashama

    Repository migration from 2.8.3 to 3.8.1

    francesco.gapito

      Hi,

       

      is there some guidelines to follow to migrate a 2.8.3 repository to a new 3.8.1 repository? Is the xml "export and reimport" the only way to do that?

       

      Thank you.

       

      Regards.

       

      Francesco.

        • 1. Re: Repository migration from 2.8.3 to 3.8.1
          hchiorean

          XML import/export is pretty much the only automated way you can do this right now. If you're going to give this a try, make sure you're using the "system view" because IIRC it's more powerful than the document view.

          However, you need to be aware that there are some limitations: if you're using versioning or locks for example, those will not be imported back via XML (see [MODE-1864] Be able to import/export versionable node with its version history - JBoss Issue Tracker) for more on this issue.

          • 2. Re: Repository migration from 2.8.3 to 3.8.1
            francesco.gapito

            Thank you Horia for you precious advice! I will do that in the way you suggested to me.

            • 3. Re: Repository migration from 2.8.3 to 3.8.1
              mashama

              Would this be the same recommendation when migrating a repository from 3.7 to 4.0?

              • 4. Re: Repository migration from 2.8.3 to 3.8.1
                hchiorean

                Moving from 3.x to 4.x we suggest using the Repository Backup/Restore extension: https://docs.jboss.org/author/display/MODE40/Backup+and+restore#Backupandrestore-MigratingfromModeShape2.8to3.0or3.1 as it operates at a lower (internal) level and should port all the repository information. This will require writing a bit of code though (to backup the old data and then restore the new data)

                • 5. Re: Repository migration from 2.8.3 to 3.8.1
                  rhauch

                  You can use ModeShape's backup and restore feature to migrate from 3.8 to 4, but see the documentation in that link for all the details.

                  • 6. Re: Repository migration from 2.8.3 to 3.8.1
                    mashama

                    Does the backup and restore capability work when running ModeShape within JBoss EAP?  I thought I saw some tickets that indicated this functionality was broke in a JBoss EAP 6.x and ModeShape 3.x configuration.

                     

                    Should I just found this ticket which suggests I need upgrade from ModeShape 3.7.1 to ModeShape 3.8.1 and EAP 6.1 to EAP 6.3 in order to utilize the backup/restore capability.  Is this true?

                    • 7. Re: Repository migration from 2.8.3 to 3.8.1
                      mashama

                      Didn't see Randall response there.  Thanks for updating the documentation.  I don't think I can upgrade to 3.8.x in-place especially if I need to upgrade to EAP 6.3...

                      • 8. Re: Repository migration from 2.8.3 to 3.8.1
                        mashama

                        So I just attempted the upgrade on my Windows 7 machine.  Ultimately this process will need to happen on our RHEL systems.  After upgrading from 3.7 to 3.8.1 I backed up the repository and then attempted a restore to a 4.2 repository.  First thing I noticed were problems restoring the repository.

                        2015-03-11 04:08:31,509 WARN  [com.chp.[***anonymized***].util.ModeShape] (default task-2) The '[***anonymized***]' repository cannot be restarted after being restored: java.lang.NoSuchMethodError: org.jboss.security.AuthenticationManager.logout(Ljava/security/Principal;Ljavax/security/auth/Subject;)V

                         

                        I assumed this issue was benign and restarted the application.  After touching the repository through modeshape-rest I saw the 4.0.0.Alpha1 upgrade function initiate.  After 5 minutes I believe it died due to a transaction timeout.   After restarting again I noticed the following error after 10 minutes:

                        2015-03-11 11:38:25,126 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: WildFly 8.1.0.Final "Kenny" started in 57572ms - Started 1217 of 1311 services (169 services are lazy, passive or on-demand)

                        2015-03-11 11:48:04,980 ERROR [org.modeshape.jcr.cache.RepositoryCache] (default task-2) Repository '[***anonymized***]' is still not fully upgraded after 10 minutes. SOME PROBLEMS MAY EXIST BECAUSE OF THIS.

                        2015-03-11 11:48:04,986 ERROR [org.modeshape.web.jcr.rest.ModeShapeExceptionMapper] (default task-2) Server error: javax.jcr.RepositoryException: Error while starting '[***anonymized***]' repository: Repository '[***anonymized***]' is still not fully upgraded after 10 minutes. SOME PROBLEMS MAY EXIST BECAUSE OF THIS.

                         

                        I assume the upgrade attempt failed, because of the default 5 minute transaction timeout, and that there is no way to recover from this failure.  I am going to attempt to manually set the timeout large enough so that the upgrade function can complete.  I will let you know what happens.

                         

                        Anything wrong with my analysis?  I am going to attach the log so you can see what I experienced during this initial attempt.

                        • 9. Re: Repository migration from 2.8.3 to 3.8.1
                          mashama

                          I have been forced to question my initial assumption.  If ModeShape cannot restart the repository as part of the restoration process, then I have no means of controlling the transaction boundaries of update function that I saw happen after the restart.  So I need some insight into the origins of the NoSuchMethodError exception.  Why would this happen?

                           

                          Does the restoration process include upgrading the repository?

                          • 10. Re: Repository migration from 2.8.3 to 3.8.1
                            hchiorean

                            If you backup a repository created with 3.8.1 and then restore it using 4.2.0, ModeShape will attempt to upgrade some internal data each time you start the repository, until this operation is successful. In the attached log this operation is failing because the Infinispan cache does not detect an active transaction during the upgrade operation, even though ModeShape starts this transaction. This can happen for a number of reasons, including the cache being non transactional or your application's classpath containing duplicate/invalid transaction related jars.

                             

                            java.lang.NoSuchMethodError: org.jboss.security.AuthenticationManager.logout(Ljava/security/Principal;Ljavax/security/auth/Subject;)V
                            
                            

                             

                            is an indication that the version of picketbox in the classpath is incorrect: ModeShape 4.2.0 was built to run on Wildfly 8.2.0 which uses picketbox 4.0.21.Final. Wildfly 8.1.0 on the other hand (which is what you're using) uses 4.0.21.Beta1 which isn't API compatible, hence the error.

                            The solution (if you want to use ModeShape 4.2.0) is to run on Wildfly 8.2.0.Final.

                            • 11. Re: Repository migration from 2.8.3 to 3.8.1
                              hchiorean

                              The message:

                              2015-03-11 11:27:03,721 ERROR [org.modeshape.jcr.RepositoryIndexManager] (default task-4) Error while refreshing index definitions for the "[***anonymized***]" repository: java.lang.NullPointerExceptio
                              

                              which you're seeing in the logs is caused by a bug somewhere in the backup/restore logic. We'll look to fix this for 4.3

                              • 12. Re: Repository migration from 2.8.3 to 3.8.1
                                mashama

                                Should I create a ticket for tracking?  Also what impact does this have on the restore process?

                                • 13. Re: Repository migration from 2.8.3 to 3.8.1
                                  hchiorean

                                  Sure, you can open a ticket if you want to.

                                  • 14. Re: Repository migration from 2.8.3 to 3.8.1
                                    mashama

                                    Done.  Should I continue my migration efforts on Wildfly 8.2 and ModeShape 4.2 or wait for this issue to be fixed?

                                     

                                    [MODE-2449] Error refreshing index definitions when restoring a repository - JBoss Issue Tracker

                                    1 2 Previous Next