Jira Cloud backup script for Windows

Hi there,

does anyone have a script to run a JIRA cloud backup from a windows machine?




1 answer

Hey Marko,


You may want to try the following:

  • Install cURL - http://www.confusedbycode.com/curl/ (scroll down that page and choose the version “With Administrator Privileges” - 32 or 64bits, depending on your version)
  • Install Git - http://git-scm.com/downloads (make sure you check option Git Bash while installing Git)
  • Paste the following code to notepad:








# Grabs cookies and generates the backup on the UI. 

TODAY=`date +%Y%m%d`


curl --silent -u $USERNAME:$PASSWORD --cookie-jar $COOKIE_FILE_LOCATION https://${INSTANCE}/Dashboard.jspa --output /dev/null

BKPMSG=`curl -s --cookie $COOKIE_FILE_LOCATION --header "X-Atlassian-Token: no-check" -H "X-Requested-With: XMLHttpRequest" -H "Content-Type: application/json"  -X POST https://${INSTANCE}/rest/obm/1.0/runbackup -d '{"cbAttachments":"true" }' `

BKPMSG_CON=`curl -s --cookie $COOKIE_FILE_LOCATION --header "X-Atlassian-Token: no-check" -H "X-Requested-With: XMLHttpRequest" -H "Content-Type: application/json"  -X POST https://${INSTANCE}/wiki/rest/obm/1.0/runbackup -d '{"cbAttachments":"true" }' `



#Checks if the backup procedure has failed

if [ `echo $BKPMSG | grep -i backup | wc -l` -ne 0 ]; then

#The $BKPMSG variable will print the error message, you can use it if you're planning on sending an email




#Checks if the backup exists in WebDAV every 10 seconds, 20 times. If you have a bigger instance with a larger backup file you'll probably want to increase that.

for (( c=1; c<=20; c++ ))


wget --user=$USERNAME --password=$PASSWORD --spider https://${INSTANCE}/webdav/backupmanager/JIRA-backup-${TODAY}.zip >/dev/null 2>/dev/null


if [ $OK -eq 0 ]; then



sleep 10



#If after 20 attempts it still fails it ends the script.

if [ $OK -ne 0 ];





#If it's confirmed that the backup exists on WebDAV the file get's copied to the $LOCATION directory.

wget --user=$USERNAME --password=$PASSWORD -t 0 --retry-connrefused https://${INSTANCE}/webdav/backupmanager/JIRA-backup-${TODAY}.zip -P $LOCATION >/dev/null 2>/dev/null

wget --user=$USERNAME --password=$PASSWORD -t 0 --retry-connrefused https://${INSTANCE}/webdav/backupmanager/Confluence-backup-${TODAY}.zip -P $LOCATION >/dev/null 2>/dev/null



Edit the username, password and instance URL to match yours, and save that file with an .sh extension.

Then, open Git Bash, navigate to the folder where your .sh file is saved, and execute it:



Once it finishes, navigate to https://<your_instance>/webdav/backupmanager/ and the backup generated should be stored there.




Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Wednesday in Jira

Join our webinar: How 1B+ feature flag events helped us build the new Jira

Every time you release software, there's a bit of risk – that there's a bug, that something breaks, or that the feature doesn't resonate with customers. Feature flagging helps make high stakes s...

136 views 0 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you