How to migrate emoticons to a different server
目的
This article describes how to include emoticons in the data export from Hipchat Server and import them manually into a new instance.
Solution #1 (HipChat Server 2.x)
Log in to the Hipchat Server command line and call the service below to export your data, including the custom emoticons. This doesn't include 1-on-1 user chats. Be sure to insert <your_user_id> (must be a group admin) and <your_passphrase> (for encryption and decryption purposes):
This step will trigger an actual export of your data without any messages. The export will only include rooms, users and emoticons information as well a zip that contains all the emoticons.
curl -X POST --header "content-type: application/json" -d '{"user_id":<your_user_id>, "passphrase":"<your_passphrase>", "include_messages":false, "include_emoticons":true}' 127.0.0.1:7777/export/group/1
Check the status of the export until it is done:
hipchat export -c
Once the export bundle is ready, record the URL from the previous command and download the file. For example:
wget https://<your_fqdn>/files/1/1/gQMxu4m0LZNrjDB/hipchat-2017-03-20_17-49-31.tar.gz.aes
Decrypt the export archive:
openssl aes-256-cbc -d -in hipchat-2017-03-20_17-49-31.tar.gz.aes -out hipchat-2017-03-20_17-49-31.tar.gz
Un-compress the archive to a separate directory:
mkdir data/ && tar xzvf hipchat-2017-03-20_17-49-31.tar.gz -c data/
- Download data/emoticons.zip locally, note that this zip only contains your custom emoticons. The default ones will be in your Hipchat instance by default.
- Drag and drop emoticons.zip into https://<your_fqdn>/emoticons
Got tons of emoticon ideas? Drop a zip with your images, even animated gifs
- Confirm the emoticons shortcuts and click Add Emoticons.
Solution #2 (HipChat Server 1.3.x)
Obtain root access to your instance by running the command on the server terminal / SSH console where the emoticons are hosted:
sudo dont-blame-hipchat
Run the following command to zip all the emoticons in a folder. In this example, it is zipped as emoticons.zip in the /home/admin location:
zip /home/admin/emoticons.zip /file_store/cumulus/posixdata/f/*.png
Download the generated file to the machine that you are currently on through the terminal. For example (Mac OS):
scp admin@<fqdn>:/home/admin/emoticons.zip /Users/<user>/Desktop/emoticons.zip
制限事項
The emoticon upload tool - https://<fqdn>/emoticons can only handle a maximum of 50 emoticons per zip file at one time. If you have more than 50 emoticons, we suggest you to unzip the file, create new files with a maximum of 50 emoticons per file, and re-zip new files again. For example (150 emoticons):
- emoticon_upload_1.zip: 50 emoticons
- emoticon_upload_2.zip: the next 50 emoticons
- emoticon_upload_2.zip: the last 50 emoticons
- Log in to your target instance's web interface and navigate to https://<fqdn>/emoticons
- Drag and drop the new .zip files to the upload tool and repeat the steps until all .zip files are uploaded to the new instance
- Confirm that the emoticons are working by logging out and logging in again from the current session that you are on before typing in the shortcut on the client