Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-2452

Allow backup/restore to be performed via the REST service

    Details

      Description

      When it comes to data migration, ModeShape offers a backup&restore mechanism via its API. However, for clients to be able to use this, they would have to write code.
      So a client migrating between 2 different versions of ModeShape which are binary-incompatible(thanks to Infinispan) would effectively have to:
      1. write code which uses the backup API and run this code on the old version of ModeShape - which also means that the backup API would be the one from the old version
      2. update the version of ModeShape & start a fresh/empty repository using the new version
      3. write code which uses the restore API from the new version and restore the repository from the backup created at step 1.
      If the client is running ModeShape in a server (e.g. Wildfly/EAP) steps 1-3 become a lot more complicated since they require the client writing & deploying the code against a running application server -i.e. all the code has to be run server-side.

      Even though the above steps are technically possible, this enhancement proposes a simplification of this process by enhancing ModeShape's existing REST service allowing the backup & restore operations:

      • to perform a repository backup, one would issue a
        Unable to find source-code formatter for language: txt. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
        GET http://modeshape-rest/repositoryName/backup?option1=value1&option2=value2
        

        request which would perform a repository backup in a temporary directory on the server (e.g. java.io.tmpdir) and then serve a zip of the backup to the user for download.

      • to perform a repository restore, one would have to use a zip produced by the backup request and issue a
        Unable to find source-code formatter for language: txt. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
        POST http://modeshape-rest/repositoryName/restore?option1=value1&option2=value2
        

        providing the ZIP file in the body of the request. In its simplest form, clients can use CURL:

        Unable to find source-code formatter for language: txt. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
        curl -X POST --data-binary @backup.zip http://modeshape-rest/repositoryName/restore?option1=value1&option2=value2
        

      Even though this enhancement isn't the ultimate in terms of the usability of backup & restore, I think it's a step forward in simplifying the process. Once MODE-2443 is implemented, we should also have full UI support.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                hchiorean Horia Chiorean
                Reporter:
                hchiorean Horia Chiorean
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: