Skip to content

livesense-inc/hipchat-exporter

Repository files navigation

HipChat Exporter

CircleCI

Export the history (messages) of rooms from HipChat.

Motivation

Requirements

image

Usage

Step 1) Export rooms and save them to DB

bundle exec thor task:room:export

Step 2) Export the history of rooms to JSON files

# bundle exec thor help history:export
Usage:
  thor task:history:export

Options:
  [--from=FROM]  # Date (or Time) like "20180101"
  [--to=TO]      # Date (or Time), like "20180131", default is Time.current
  [--threads=N]  # Threads count for speedup blocking operations
  [--force]      # Skip asking questions

Example:

bundle exec thor task:history:export --from=20171101 --to=20171107 --threads=20

Step 3) Save the history of rooms to DB

bundle exec thor task:history:save

Step 4) Export the messages to CSV files

bundle exec thor task:message:export

The messages CSV files are exported to dist directory.

Step 5) Import messages CSV files to Slack

Other (show tasks list)

bundle exec thor -T
task
----
thor task:history:clear   # Remove room history JSON files
thor task:history:export  # Export the history of rooms to JSON files
thor task:history:save    # Save the history of rooms to DB
thor task:message:clear   # Remove messages CSV files
thor task:message:export  # Export the messages to CSV files
thor task:room:export     # Export rooms and save them to DB
thor task:room:map        # Map room names in CSV file and room ids in DB

Setup

git clone [email protected]:livesense-inc/hipchat-exporter.git
cd hipchat-exporter
bundle install --path vendor/bundle
bundle exec rake db:create
bundle exec rake db:migrate
cp .env.example .env

Fill HIPCHAT_TOKEN in .env

cp rooms.csv.example rooms.csv

Fill room_id and room_name in rooms.csv (room_name is optional)

Debugging

bundle exec pry

Testing

bundle exec rspec

Other

Reset the database

db:reset -> db:drop && db:create && db:migarete

bundle exec rake db:reset

Map room names in CSV file and rooms in DB and show room id list

cp room_names.csv.example room_names.csv

Fill room names room_names.csv

bundle exec thor task:room:export
bundle exec thor task:room:map

About

Export the history (messages) of rooms from HipChat.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages