How to create a Confluence 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 Confluence web interface, the UI, is not working properly, run and get the support zip is a challenge, requiring Confluence or a System administrator to collect log and configuration files by logging on the server where a Confluence node is running to retrieve them manually.  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.
  • Recognize and have read permission on Confluence Home and Confluence Application folders (recommended root/Administrator or the Jira user if using Linux).

(warning) Attention when using Confluence Data Center with multiple nodes, the script shall be run in each node separately.

Script and its usage

Below you may find the script, how to use and expected output.

Linux

Linux

Script

File: supportzip_connie.sh

Usage

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

The support.zip file will be placed at <confluence-home>/export.

Output

# ./supportzip_connie.sh -h /opt/atlassian/confluence/confluence-home -a /opt/atlassian/confluence/atlassian-confluence-7.13.4

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


##############################
# Atlassian support zip tool #
##############################
User = confluence
Confluence Home = /opt/atlassian/confluence/confluence-home
Confluence App Directory = /opt/atlassian/confluence/atlassian-confluence-7.13.4

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

 - Packing application logs
cp: /opt/atlassian/confluence/confluence-home/logs/support is a directory (not copied).
 - Packing application config files
 - Packing configuration summary, if any available
 - Packing the last directoryConfigurationSummary available.
 - Packing seraph and crowd configuration files
 - Packing confluence customisations files
cp: /opt/atlassian/confluence/confluence-home/logs/support/customHtml.txt}: No such file or directory
cp: /opt/atlassian/confluence/confluence-home/logs/support/customStylesheet.txt}: No such file or directory
 - Packing custom layouts files
 - Packing synchrony configuration file
 - Packing cache configuration files
cp: /cache-settings-overrides.properties: No such file or directory
 - Packing tomcat configuration files
 - Packing healthcheckResults, if any available
 - Packing Tomcat logs
 - Packing the application.xml, if any available
 - Thread dump will not be collected

Creating zip file...

The support zip file can be found in /opt/atlassian/confluence/confluence-home/export/Confluence_support_2022-05-19-14-07-25.zip, please upload this file to Atlassian.
.
Have a g'day =) 


Zip file structure (example from test environment, yours may be different):

Confluence_support_2022-05-19-14-07-25
├── application-config
│   ├── confluence-init.properties
│   ├── confluence.cfg.xml
│   ├── log4j-diagnostic.properties
│   ├── log4j.properties
│   ├── logging.properties
│   ├── setclasspath-bat.txt
│   ├── setclasspath-sh.txt
│   ├── setenv-bat.txt
│   ├── setenv-sh.txt
│   ├── shutdown-bat.txt
│   ├── shutdown-sh.txt
│   ├── start-confluence-bat.txt
│   ├── start-confluence-sh.txt
│   ├── startup-bat.txt
│   ├── startup-sh.txt
│   ├── stop-confluence-bat.txt
│   ├── stop-confluence-sh.txt
│   └── web.xml
├── application-logs
│   ├── atlassian-confluence-index.log
│   ├── atlassian-confluence-index.log.1
│   ├── atlassian-confluence-jmx.log
│   ├── atlassian-confluence-outgoing-mail.log
│   ├── atlassian-confluence-profiler.log
│   ├── atlassian-confluence-security.log
│   ├── atlassian-confluence-sql.log
│   ├── atlassian-confluence.log
│   ├── atlassian-confluence.log.1
│   ├── atlassian-confluence.log.2
│   ├── atlassian-confluence.log.3
│   ├── atlassian-confluence.log.4
│   ├── atlassian-confluence.log.5
│   ├── atlassian-diagnostics.log
│   ├── atlassian-synchrony.log
│   └── atlassian-synchrony.log.1
├── application-properties
│   └── application.xml
├── auth-cfg
│   ├── May-16.directoryConfigurationSummary.txt
│   ├── crowd.properties
│   ├── seraph-config.xml
│   └── seraph-paths.xml
├── cache-cfg
├── confluence-customisations
│   └── layouts
│       ├── Space FirsSpace customised layout - decorators-main.vmd
│       ├── Space FirsSpace customised layout - decorators-page.vmd
│       ├── Space FirsSpace customised layout - decorators-space.vmd
│       └── customLayouts.txt
├── healthchecks
│   └── healthcheckResults.txt
├── synchrony-config
│   └── synchrony-args.properties
├── thread-dump
├── tomcat-config
│   ├── catalina.policy
│   ├── catalina.properties
│   ├── context.xml
│   ├── jaspic-providers.xml
│   ├── logging.properties
│   ├── server.xml
│   ├── tomcat-users.xml
│   └── web.xml
└── tomcat-logs
    ├── atlassian-synchrony-proxy.log
    ├── catalina.2022-04-01.log
    ├── catalina.2022-04-04.log
    ├── catalina.2022-04-05.log
    ├── catalina.2022-04-06.log
    ├── catalina.2022-04-07.log
    ├── catalina.2022-04-09.log
    ├── catalina.2022-04-11.log
    ├── catalina.2022-04-17.log
    ├── catalina.2022-04-18.log
    ├── catalina.2022-04-25.log
    ├── catalina.2022-04-29.log
    ├── catalina.2022-05-02.log
    ├── catalina.2022-05-04.log
    ├── catalina.2022-05-05.log
    ├── catalina.2022-05-06.log
    ├── catalina.2022-05-07.log
    ├── catalina.2022-05-11.log
    ├── catalina.2022-05-16.log
    ├── catalina.2022-05-18.log
    ├── catalina.out
    ├── conf_access_log.2022-04-19.log
    ├── conf_access_log.2022-04-20.log
    ├── conf_access_log.2022-04-21.log
    ├── conf_access_log.2022-04-22.log
    ├── conf_access_log.2022-04-23.log
    ├── conf_access_log.2022-04-24.log
    ├── conf_access_log.2022-04-25.log
    ├── conf_access_log.2022-04-29.log
    ├── conf_access_log.2022-05-02.log
    ├── conf_access_log.2022-05-03.log
    ├── conf_access_log.2022-05-04.log
    ├── conf_access_log.2022-05-05.log
    ├── conf_access_log.2022-05-06.log
    ├── conf_access_log.2022-05-07.log
    ├── conf_access_log.2022-05-08.log
    ├── conf_access_log.2022-05-09.log
    ├── conf_access_log.2022-05-10.log
    ├── conf_access_log.2022-05-11.log
    ├── conf_access_log.2022-05-12.log
    ├── conf_access_log.2022-05-13.log
    ├── conf_access_log.2022-05-14.log
    ├── conf_access_log.2022-05-15.log
    ├── conf_access_log.2022-05-16.log
    ├── conf_access_log.2022-05-17.log
    ├── conf_access_log.2022-05-18.log
    ├── conf_access_log.2022-05-19.log
    ├── gc-2022-04-01_14-54-55.log.0.current
    ├── gc-2022-04-01_15-00-44.log.0.current
    ├── gc-2022-04-01_15-28-07.log.0.current
    ├── gc-2022-04-01_15-41-19.log.0.current
    ├── gc-2022-04-01_15-46-34.log.0.current
    ├── gc-2022-04-01_16-06-19.log.0.current
    ├── gc-2022-04-01_16-12-43.log.0.current
    ├── gc-2022-04-04_16-25-35.log.0.current
    ├── gc-2022-04-04_16-32-47.log.0.current
    ├── gc-2022-04-04_16-47-57.log.0.current
    ├── gc-2022-04-09_22-25-36.log.0.current
    ├── gc-2022-04-17_12-27-43.log.0.current
    ├── gc-2022-04-25_15-09-12.log.0.current
    ├── gc-2022-04-25_15-34-24.log.0.current
    ├── gc-2022-04-25_15-44-24.log.0.current
    ├── gc-2022-04-25_17-34-47.log.0.current
    ├── gc-2022-04-29_14-19-27.log.0.current
    ├── gc-2022-04-29_14-53-42.log.0.current
    ├── gc-2022-05-02_13-49-00.log.0.current
    ├── gc-2022-05-02_14-06-16.log.0.current
    ├── gc-2022-05-16_12-05-26.log.0.current
    ├── host-manager.2022-04-01.log
    ├── host-manager.2022-04-04.log
    ├── host-manager.2022-04-09.log
    ├── host-manager.2022-04-17.log
    ├── host-manager.2022-04-25.log
    ├── host-manager.2022-04-29.log
    ├── host-manager.2022-05-02.log
    ├── host-manager.2022-05-16.log
    ├── localhost.2022-04-01.log
    ├── localhost.2022-04-04.log
    ├── localhost.2022-04-09.log
    ├── localhost.2022-04-17.log
    ├── localhost.2022-04-25.log
    ├── localhost.2022-04-29.log
    ├── localhost.2022-05-02.log
    ├── localhost.2022-05-16.log
    ├── manager.2022-04-01.log
    ├── manager.2022-04-04.log
    ├── manager.2022-04-09.log
    ├── manager.2022-04-17.log
    ├── manager.2022-04-25.log
    ├── manager.2022-04-29.log
    ├── manager.2022-05-02.log
    ├── manager.2022-05-16.log
    └── synchrony-proxy-watchdog.log
  



Windows

Windows

Script

File: connie-supportzip.ps1

Usage

The basic script shall be run as follows:

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

With details:

Usage: .\connie-supportzip.ps1 [-h <confluence home path>] [-a <confluence app path>]
          -h: obligatory, absolute path of confluence home directory
          -a: obligatory, absolute path of confluence 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\Confluence", and

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

The final command shall be (using Powershell):

  .\connie_support_zip.ps1 -h "C:\Program Files\Atlassian\Application Data\Confluence" -a "C:\Program Files\Atlassian\Confluence"

With details:

 C:\> .\connie_support_zip.ps1 -h "C:\Program Files\Atlassian\Application Data\Confluence" -a "C:\Program Files\Atlassian\Confluence"

        __          ------------------------------------------
 _(\    |@@|        | Beep - Generating Atlassian Support Zip  |
(__/\__ \--/ __    /_------------------------------------------
   \___|----|  |   __
       \ }{ /\ )_ / _\
       /\__/\ \__O (__
      (--/\--)    \__/
      _)(  )(_
# Atlassian support zip tool #
##############################
2024-12-18_09-06
Confluence Home = C:\Program Files\Atlassian\Application Data\Confluence
Confluence App = C:\Program Files\Atlassian\Confluence
Current user = ec2amaz-55f3hb0\administrator
.
Hit CTRL+C (10s wait) if any path or user is incorrect.
 - Creating basic structure
 - Packing application logs
 - Packing application config files
 - Packing application config files
 - Packing configuration summary, if any available
 - Packing the last directoryConfigurationSummary available.
 - Packing confluence customisations files
 - Packing custom layouts files
 - Packing synchrony configuration file
 - Packing tomcat configuration files
 - Packing healthcheck results, if any available
 - Packing all Tomcat logs
 - Packing access logs
 - Packing the application.xml, if any available
 - Coppying last available application.xml
.
Creating zip file...
.
.
.
.
The support zip file can be found in C:\Program Files\Atlassian\Application Data\Confluence/export/confluence_support_2024-12-18_09-06.zip, please upload this file to Atlassian.
.
Have a g'day =)
.


For both Linux and Windows the support.zip generated  <confluence-home>/export .

Other Notes

  • This solution is not a substitute of UI Support Zip.
  • Username and passwords are sanitized in confluence.cfg.xml,  directoryConfigurationSummary (directories) and server.xml/tomcat-users.xml (tomcat configuration) when using Linux, for Windows it is still in progress.



Last modified on Dec 19, 2024

Was this helpful?

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