Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Performing a data-only backup via REST API

Pierangelo Repetti
Contributor
October 7, 2019

Hello,

at present, the scripts here

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

are all we've got to build an automatic backup procedure for JIRA Cloud. Fine.

How can we change/use the backup-jira-api-token.sh script to perform a data-only backup excluding attachments, avatars, and logos ?

Thank you

Pierangelo

 

2 answers

1 accepted

2 votes
Answer accepted
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 8, 2019

Hi @Pierangelo Repetti ,

In order to change the backup script so that it does not  include attachments you have to change line 31 of the backup-jira-api-token.sh script:

BKPMSG=$(curl -s -u ${EMAIL}:${API_TOKEN} -H "Accept: application/json" -H "Content-Type: application/json" --data-binary '{"cbAttachments":"true", "exportToCloud":"true"}' -X POST https://${HOSTNAME}/rest/backup/1/export/runbackup )

 

Specifically, you have to change the payload sent with the request from:

{"cbAttachments":"true", "exportToCloud":"true"}

 

To:

{"cbAttachments":"false", "exportToCloud":"true"}

 

Please test this and let me know if it works.

 

Also, I will try to modify the script so that it is possible to configure at the top of it whether the backup is for Server or Cloud and whether to include the attachments.

 

 

 

Cheers,
Dario

Pierangelo Repetti
Contributor
October 9, 2019

I applied the change you suggested. I think it is working because the zip file created by the script is much much smaller than the full backup I created from JIRA administration.

I'll accept your answer.

A parameter in the configuration section would be great.

Thank you very much.

Like • 2 people like this
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 9, 2019

You are very welcome @Pierangelo Repetti ,

As soon as I will have some time I will try to add those properties to the top of the script.

 

Ciao,
Dario

Jagadeesh_M October 11, 2022

hi @Dario B 

Will "cbAttachment":"true" cover also Avatars and logos?.

Regards

0 votes
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 15, 2019 edited

Hi @Pierangelo Repetti ,

Just FYI, I have committed the updated Bash scripts to backup Jira and Confluence Cloud so that you can choose:

  • Jira: to generate a backup for Cloud or Server and whether or not to include attachments
  • Confluence: whether or not to include attachments.

 

Please test them and let me know if they work.

 

 

Cheers,
Dario

Pierangelo Repetti
Contributor
October 18, 2019

Hello Dario,

I tested the Confluence script, it is working.

Thanks for your work.

Pierangelo

Like • Dario B likes this
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 22, 2019

You are very welcome @Pierangelo Repetti ! :) 

Like • Vignesh likes this
Quang Pham
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 25, 2020

Please send me a link to Jira: to generate a backup for Cloud 

Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 26, 2020 edited

Hi @Quang Pham ,

I am not sure I understand what you are asking for, since the endpoints to start a backup are listed in the scripts you can find in the repository mentioned in the very first message of this thread:

 

In case this won't help, kindly provide more details on what you are trying to do/achieve

 

 

Cheers,
Dario

Ethan Vaughan July 25, 2023

@Dario B I am running this script successfully but I am interested in finding an alternative to this script that will run the backup for server. How can I modify this script to grab that backup instead of the backup for Cloud?

Background; we're trying to develop a method of off-site automated backups.

Thanks,

Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 25, 2023

Hello @Ethan Vaughan ,

I am only working with Cloud products so I might not be the best person to help here.

However, once this has been said, as mentioned in Configuring automatic database backups documentation page, for PROD Jira Server and Datacenter sites we advise to take DB backups instead:

For large Jira installations and regular backups in production, we strongly recommend that you use native database backup tools instead of Jira's XML backup service.

Native database backup tools offer a much more consistent and reliable means of storing (and restoring) data while Jira is active. When Jira is in use, there’s no guarantee that XML backups will be consistent as the database may be updated during the backup process. Jira doesn't report any warnings or error messages when an XML backup is generated with inconsistencies and such backups will fail during the restore process.

For more details on this please see the Backing up data documentation page.

 

If for some reason this is not desired, another option would be to install Jira Server on a VM and take snapshots.

Finally, if you really want to have something like the Cloud backup scripts, you can proceed as it follows:

 

I hope this helps.

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, atlassian community, loom ai, atlassian loom ai, loom, atlassian ai, record recaps of meetings, meeting recaps, loom recaps, share meeting recaps,

Loom’s guide to great meetings 📹

Join us to learn how your team can stay fully engaged in meetings without worrying about writing everything down. Dive into Loom's newest feature, Loom AI for meetings, which automatically takes notes and tracks action items.

Register today!
AUG Leaders

Atlassian Community Events