Using the Auto-Archive script for HipChat Server

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

Purpose

Archiving unused, inactive, empty rooms in HipChat Server will reduce the amount of rooms that Tetra needs to process by removing these rooms from the room roster. This not only helps clean up the ROOMS page in the HipChat web interface, but also has a marginal performance boost depending on how many rooms are archived.

Script details

  • This script will cycle through all non-deleted and non-archived rooms, determines the 'activity' in each room (activity being last message, room creation date, etc), then calculates (based on the threshold time variable selected) if the room should be archived or not.
  • Rooms that contain no history will be archived as well.
  • This script can be manually ran or ran via Cron scheduling.
  • Uses python and must be executed in the /hipchat-scm/fishtank/tools directory.

(warning) You should always backup your HipChat Server data (either via VM level snap-short or using the exporter - Exporting and Importing your HipChat data) before performing the archive.

Installation and Usage

  1. Download the Auto-Archive script to the HipChat Server: auto-archive.py
  2. Gain root:

    sudo dont-blame-hipchat
  3. Move the script to the /hipchat-scm/fishtank/tools directory on HipChat Server.
  4. Make this script executable:

    chmod +x auto-archive.py
  5. Execute the script, setting the threshold (in days) after the script, i.e.

    ./auto-archive.py n

    (info) Where n is threshold in days. For example:

    ./auto-archive.py 5

    Would archive all rooms that have their last activity older than 5 days. Rooms that have activity newer than 5 days out will be unaffected.


Last modified on Jun 26, 2019

Was this helpful?

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