Uploaded image for project: 'Jira Cloud'
  1. Jira Cloud
  2. JRACLOUD-67169

JIRA backup script returns 404 in the new infrastructure

    XMLWordPrintable

Details

    Description

       Please notice that this only applies to the new infrastructure. The old endpoints are still working fine in the old infrastructure

      Summary

      Running a JIRA backup from command line or from a script fails. The endpoint rest/obm/1.0/runbackup is now returning: 404 - page not found

      As mentioned in the KB article "How to Automate Backups for JIRA Cloud applications" this is not fully supported but, if the endpoint has been removed, then we should either update the documentation or make it work again.

      Steps to Reproduce

      1. Either use the Atlassian Labs automatic-cloud-backup script or run the below commands:
        curl -D- -c cookie.txt -H "Content-Type: application/json" -d '{"username":"EMAIL", "password":"PASSWORD" }' -X POST https://HOSTNAME/rest/auth/1/session
        
        curl --cookie cookie.txt --header "X-Atlassian-Token: no-check" -H "X-Requested-With: XMLHttpRequest" -H "Content-Type: application/json"  -X POST https://HOSTNAME/rest/obm/1.0/runbackup -d '{"cbAttachments":"true" }'  
        

      Expected Results

      A JIRA backup is started and you can check the progress by calling the below endpoint:

      curl --cookie cookie.txt https://HOSTNAME/rest/obm/1.0/getprogress.json
      

      Actual Results

      An error is returned instead:

      curl --cookie cookie.txt --header "X-Atlassian-Token: no-check" -H "X-Requested-With: XMLHttpRequest" -H "Content-Type: application/json"  -X POST https://HOSTNAME/rest/obm/1.0/runbackup -d '{"cbAttachments":"true" }' 
      
      
      <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>Oops, you&#39;ve found a dead link. - JIRA</title><script type="text/javascript">contextPath = "";</script><link type='text/css' rel='stylesheet' href='/static-assets/metal-all.css' media='all'><script src='/static-assets/metal-all.js'></script><!--[if lt IE 9]><link type='text/css' rel='stylesheet' href='/static-assets/metal-all-ie.css' media='all'><script src='/static-assets/metal-all-ie.js'></script><![endif]--><!--[if IE 9]><link type='text/css' rel='stylesheet' href='/static-assets/metal-all-ie9.css' media='all'><![endif]--><meta name="decorator" content="none" /></head><body class=" error-page error404"><script type="text/javascript">document.body.className += " js-enabled";</script><div id="page"><header id="header" role="banner"></header><!-- #header --><section id="content" role="main"><div class="aui-page-panel"><div class="aui-page-panel-inner"><section class="aui-page-panel-content lowerContent"><div id="error-state"><span class="error-type"></span><h1>Oops, you&#39;ve found a dead link.</h1><ul><li>Go back to the <a href="javascript:window.history.back()">previous page</a></li><li>Go to the <a href="/secure/MyJiraHome.jspa">Home Page</a></li></ul></div></section><!-- .aui-page-panel-content --></div><!-- .aui-page-panel-inner --></div><!-- .aui-page-panel --></section><!-- #content --><footer id="footer" role="contentinfo"><section class="footer-body"><div id="footer-logo"><a href="http://www.atlassian.com/" rel="nofollow">Atlassian</a></div></section></footer><!-- #footer --></div><!-- #page --></body></html>
      

      Workaround

      There are new endpoints to be called that are working fine. However, please notice that automatic backup from script is not officially supported and therefore the endpoints can change again in the future without any previous notice.

      I have updated the existing script by doing the following (you can do the same in case the scripts won't work anymore in the future):

      1. Open the developer tools in Chrome (or Firefox)
      2. Run the backup from the UI
      3. In the developer console check the endpoints used to run the backup and modify the existing scripts accordingly

      Below are the scripts I have just used to backup my JIRA and Confluence instances. Please use them at your own risk (and make sure you read and understand what's in there before running them):

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dbonotto Dario B
              Votes:
              29 Vote for this issue
              Watchers:
              45 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: