Jira and Confluence automated backup using script
Asked by samir 3p:

I found an article: <https://bitbucket.org/atlassianlabs/automatic-cloud-backup/src/e6eba2f9d096cfd0a7963243539d733c1d722b42/backup.sh?fileviewer=file-view-default>

This is what I have been looking for. Using an ubuntu box I can create and keep a local copy of our JIRA system.

But-

1) How do I restore files from backup\*\*.zip file ?

2) How do I do similar automated backup for confluence (I believe above script does JIRA only) ?

Thanks.


Answers:
author: Nic Brough -Adaptavist-
body: Confluence Cloud has the same function in a similar place, all you'll need to do is adjust the urls a bit.

To restore the .zip files, use the application's "restore system" function you can find under "imports" in the admin sections.

comments: author: samir 3p
body: For JIRA it is-

```
INSTANCE=example.atlassian.net
```

So I'm assuming, for confluence it'd be-

```
INSTANCE=example.atlassian.net/wiki
```

Is that right?


author: Nic Brough -Adaptavist-
body: Yes, it should be.


author: Hamdy Atakora
body: How did this work for you [@samir 3p](/t5/user/viewprofilepage/user-id/1118359) ? We have been trying to do the same on both libnux or windows but we keep getting an error that says

bash-3.2# sudo sh backup_jira.sh  
starting the script: 06-05-2019  
\<?xml version="1.0" encoding="UTF-8" standalone="yes"?\>\<status\>\<status-code\>401\</status-code\>\<message\>**Client must be authen**   
**ticated to access this resource**.\</message\>\</status\>

Has anyone ran into this issue? If so how did you resolve it?

Thank you in advance.


author: Dario B
body: [@Hamdy Atakora](/t5/user/viewprofilepage/user-id/3017015)

You are using an outdated version of the scripts that is still using cookie authentication that has been deprecated as announced long time ago in:

* [Deprecation notice - Basic authentication with passwords and cookie-based authentication](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-basic-auth-and-cookie-based-auth/)

Newer version of the scripts to backup Jira and Confluence using API Tokens are available at the below url:

* [https://bitbucket.org/atlassianlabs/automatic-cloud-backup/src/master/](https://bitbucket.org/atlassianlabs/automatic-cloud-backup/src/master/ "https://bitbucket.org/atlassianlabs/automatic-cloud-backup/src/master/")

For more details about API_Token please see:

* <https://confluence.atlassian.com/cloud/api-tokens-938839638.html>

Let me know if this helps.

Cheers,  
Dario


author: Mudassir Ali
body: I have ran the script with needful changes but its never return.


author: Dario B
body: Hello [@Mudassir Ali](/t5/user/viewprofilepage/user-id/4378315)

Welcome to the Atlassian Community!

Please notice that this is a thread from 2016 and that the script linked in the first post is outdated and does not even exist anymore in:

* <https://bitbucket.org/atlassianlabs/automatic-cloud-backup/src/master/>

As you can see there is no script named backup.sh anymore in above repository. Therefore, try to use the updated version of the desired backup script and, in case it won't work, create a new thread providing more information.

Cheers,  
Dario


Tags: backup

cloud

confluence-cloud

jira

jira-cloud