A Ruby program for migrating the Phabricator issues to Discourse topics.
- Installed version of Ruby 3
- A Phabricator API key
- A Discourse API key with sufficient permissions to make a bunch of topics
- call the phabricator API to get all the issues
- call the phabricator API to get all the users
- call the phabricator API to get all the transactions (comments, assignments, etc)
- format the data in to a large JSON file
- post it to Discourse via the Discourse API
- Create a file
.env
with the following content
PHAB_KEY=<Phabricator Conduit API key>
DISCOURSE_KEY=<Discourse API key>
PHAB_HOST='phabricator.whonix.org'
-
Ensure that Discourse has an appropriate rate limit for post requests. For us, 1000 a minute is probably ample.
-
$ ruby ./phabricator_export.rb
which outputs a JSON file./discourse_migration_data.json
-
$ ruby ./discourse_import.rb
-
Tada!
Testing is done with Ruby's built in Minitest framework.
To run them:
$ rake