Is there a best practise on how to automate backup & restore for Jira & Confluence?
I have a PROD and a TEST environment. I want to create some CI Pipeline (e.g. Jenkins) for automated backup and restore:
- PROD data should be copied & restored into TEST
- there may be some different or additional settings / projects / add-ons etc. installed on TEST - all this should be removed and the full PROD data should be used when I execute the "backup & restore" Job
- except for environment specific stuff, like Application Links, License keys, Base URL, E-Mail handlers (what else?), here of course the TEST settings should not be overridden
Is there something like a blog entry out there to give tips?
There is not a in app native method to accomplish this as covered in this feature request, and there are not direct API endpoints that can be used to do this as covered here. But to script the automated backup using a few different endpoints in combination check out the following KB article that has a link to a bitbucket repo with an example script that you can use to accomplish this:
Additionally, one thing to be aware of is a limitation in the next-gen projects currently covered in the "Exporting issues" Documentation:
Currently, exports that include next-gen software projects won't include any epic link or other relationship data between epics and their children issues. This is a known error and we're working to fix it. Thanks for your patience.
Next restoring the data is not something I have an example for, And I am not aware of a method that exists to do this. Jira Cloud instances are designed to be production instances and the backup is a read operation so safe to do against production, but the write operation or a restore does a data wipe and overwrites the current configuration and is not a good practice for a production systems and general best practice would be to restore and review to verify the data is imported correctly prior to returning the instance to full operational capacity, to avoide running into data loss such as the scenario noted above with the next-gen project epic data that requires post restore manual reallocation.
One more update on this, I was doing a bit more research and I found an add-on for Jira Cloud that can sync data between two sites that my be useful for your scenario to get the data from prod in line with the data on your test site:
Notting with this tool there would still be discrepancies in the data due to different actions performed on each site independently and a backup/restore would bring the data closest to the prod site but even if you import backups, there is no way to know which features are enabled or add-on configuration and version changes are in place in which instance such as the aforementioned epic link mappings for next-gen projects. So DEV TEST and PROD data can still be different post restore.
Being on Jira server changes things a bit, and while I do not have a full scrip exe for you as this is going to need to be configured for your environment specifically you can use the native database tools to clone the DB over and then tweaking the output a bit is the best way to go, Check out the following Post that gives some tips on how to script this, with a exe on the db dump command to update the URL's in the output:
And the following article covers the items to verify are configured per the script:
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events