How to create Jira Support Zip via command line

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

When Jira web interface, the UI, is not working properly, running and getting the Support Zip is a challenge, requiring Jira or the System administrator to collect logs and data from the Operating System. 
To facilitate it, this solution comes to automatize the log/data search and packaging using the same structure the Support Zip tool provides beyond other benefits.

Environment and requirements

The solution runs in Linux based Operating System with:

  • /bin/bash

  • zip and/or gzip applications

To run in Windows the OS might have:

  • Powershell

It's also required by the system administrator:

  • Being familiar with the Operating System command line interface.

  • Recognize the Jira Home and Jira Application folders.
  • Have read permission on Jira Home and Jira Application folders (recommended root/Administrator or the Jira user if using Linux).

(warning) Attention when using Jira Data Center with multiple nodes, the script shall be run in each node separately and the home folder refers to the Jira home from the node (not the shared home folder).

Script and its usage

Below you may find the scripts, usage, and real examples for Linux and Windows. 

Linux

Linux

Script

File: supportzip.sh

Usage

The basic script shall be run as follows:

./supportzip.sh [-h <jira home path>] [-a <jira app path>]

With details:

# ./supportzip.sh -h
Usage: ./supportzip.sh [-h <jira home path>] [-a <jira app path>] -t
          -h: obligatory, absolute path of jira home directory
          -a: obligatory, absolute path of jira application directory
          -t: optional, to collect thread dumps

Example

Below you may find an example of running the script using Linux and paths:

  • Node home folder (-h) "/opt/atlassian/jira/jira-home", and
  • Application folder (-a) "/opt/atlassian/jira/atlassian-jira-software-8.20.6-standalone"

The script call shall be set as (the "-t" is optional to generate thread dumps):

./supportzip.sh -h /opt/atlassian/jira/jira-home -a /opt/atlassian/jira/atlassian-jira-software-8.20.6-standalone -t

With details:

# ./supportzip.sh -h /opt/atlassian/jira/jira-home -a /opt/atlassian/jira/atlassian-jira-software-8.20.6-standalone -t

        __          ------------------------------------------
 _(\    |@@|        | Beep - Generating Atlassian Support Zip  |
(__/\__ \--/ __    /_------------------------------------------
   \___|----|  |   __
       \ }{ /\ )_ / _\
       /\__/\ \__O (__
      (--/\--)    \__/
      _)(  )(_
     `------`


##############################
# Atlassian support zip tool #
##############################
User = jirauser
Jira Home = /opt/atlassian/jira/jira-home/
Jira App = /opt/atlassian/jira/atlassian-jira-software-8.20.6-standalone/

Hit CTRL+C (10s wait) if any path or user is incorrect.

 - Packing application logs
 - Packing application config files
 - Packing configuration summary, if any available
 - Packing Tomcat access logs
 - Packing cache configuration files
 - Packing tomcat configuration files
 - Packing healthcheckResults, if any available
 - Packing Tomcat logs
 - Packing the application.xml, if any available
 - Generating thread dumps -  this will take ~1 minute

Creating zip file...

The support zip file can be found in /opt/atlassian/jira/jira-home/export/Jira_support_2022-04-19-10-20-48.zip, please upload this file to Atlassian.
.
Have a g'day =)

Windows

Windows

Script

File: supportzip.ps1

Usage

The basic script shall be run using powershell prompt as:

./supportzip.ps1 [-h <jira home path>] [-a <jira app path>]

With details:

Usage: .\supportzip.ps1 [-h <jira home path>] [-a <jira app path>] 
          -h: obligatory, absolute path of jira home directory
          -a: obligatory, absolute path of jira application directory

Example

Below you may find an example of running the script with Windows and paths:

  • Node home folder (-h) "C:\Program Files\Atlassian\Application Data\Jira", and

  • Application folder (-a) "C:\Program Files\Atlassian\Jira"

The final command shall be (using Powershell):

 .\supportzip.ps1 -a "C:\Program Files\Atlassian\Jira" -h "C:\Program Files\Atlassian\Application Data\Jira"

With details:

PS C:\> .\supportzip.ps1 -a "C:\Program Files\Atlassian\Jira" -h "C:\Program Files\Atlassian\Application Data\Jira"

        __          ------------------------------------------
 _(\    |@@|        | Beep - Generating Atlassian Support Zip  |
(__/\__ \--/ __    /_------------------------------------------
   \___|----|  |   __
       \ }{ /\ )_ / _\
       /\__/\ \__O (__
      (--/\--)    \__/
      _)(  )(_
# Atlassian support zip tool #
##############################
2023-08-14_01-24
Jira Home = C:\Program Files\Atlassian\Application Data\Jira
Jira App = C:\Program Files\Atlassian\Jira
Current user = ec2amaz-81f6lqb\administrator
.
Hit CTRL+C (10s wait) if any path or user is incorrect.
 - Creating basic structure
 ....
 ....
 - Packing application logs
 - Packing application config files
 - Packing configuration summary, if any available
 - Packing the last directoryConfigurationSummary available.
 - Packing all Tomcat logs
 - Packing cache configuration files
 - Packing tomcat configuration files
 - Packing healthcheck results, if any available
 - Packing the application.xml, if any available
 - Copying last available application.xml
.
Creating zip file...
.
.
.
.
The support zip file can be found in C:\Program Files\Atlassian\Application Data\Jira/export/Jira_support_2023-08-14_01-24.zip, please upload this file to Atlassian.
.
Have a g'day =)
.


For both Linux and Windows the support.zip generated file will be placed at <jira-home>/export. 

Other Notes

  • This solution is not a substitute of UI Support Zip. If you have the chance to generate the support zip though the UI, please prefer to use it. 
  • Username and passwords are sanitized in dbconfig.xml (database),  directoryConfigurationSummary (directories) and server.xml/tomcat-users.xml (tomcat configuration).




Last modified on Nov 28, 2023

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.