This tool was forked from https://github.com/PeteW/assembla2github and this repo represents the tooling made for converting the PortAudio project from Assembla to GitHub.
The tool has been significantly expanded since the original script by @PeteW.
-
Install Python 3.7
-
Install a Python virtual environment and install the packages
python -mvenv venv venv/bin/python -mpip install --upgrade pip venv/bin/pip install -r requirements.txtProcedure for Windows:
py -3.7 -mvenv venv venv\Scripts\python -mpip install --upgrade pip venv\Scripts\pip install -r requirements.txt -
in assembla source site go to settings -> export and import -> submit a request to export your tickets. the request is queued and may take several minutes. You'll eventually gain access to a downloadable backup of assembla tickets in a JSON-like format named
dump.js. -
edit the top of the assembla2github.py file, there are several project-specific mappings you must customize such as user and status mappings
-
create
auth.jsonfromauth-template.json. Edit file and set the passwords and IDs. Theassembla_*fields are only required if runninguserscrapeorwikiscrape. -
create
config.jsonfromconfig-template.jsonand fill in the fields. Thedumpfilefile must point to your downloadeddump.jsfile.
Run the python script:
venv/bin/python assembla2github.py [--config=myconfig.json] [options...] COMMAND [arguments...]
(Windows use venv\Scripts\python assembla2github.py ...)
The tool operates on the Assembla dumpfile specified in the dumpfile setting in the config file specified by --config.
If no --config option is specified, it will try to read config.json in the current directory.
The tool provides multiple operations on the Assembla dataset. The following COMMAND specifies
the wanted operation.
userscrape- Use the Assembla API to fetch the user names and store in a user dump file. This file can be used later with theuserdumpconfig option to merge with the main data.wikiscrape- Use the Assembla API to fetch the wiki page contents and store in a dump file. This file can be used later with thewikidumpconfig option to merge with the main data.wikiconvert- Extract the wiki data from the dump file database and commit all the changes into the git repo that can be pushed to GitHub. It converts the Assembla Wiki markup to GitHub markdown.ticketsconvert- FIXME.
Helper commands for debug and inspection:
dump- Debug tool to dump the Assembla datasetlsusers- List all users found in dump file.lswiki- List all wiki pages found in dump file.
The tool supports --help. Specifying no COMMAND will show all available global options. Specifying
--help after a COMMAND will show the options for that command.
The full procedure for converting the Assembla project to GitHub is outlined below.
NOTE: Please pay heed to the
WARNINGmessages the tools might output when commands are run. It could indicate missing or incorrect data during conversion.
-
Get the latest Assembla
dump.jsfile from the Assembla site (step 3 under installation/setup above).Edit
config.jsonto point thedumpfilefield to the downloadeddump.jsfile. -
Fetch the user data from Assembla using:
assembla2github.py userscrape users.jsEdit
config.jsonand add this file to theuserdumpfield. -
Fetch the wiki pages from Assembla API:
assembla2github.py wikiscrape wikipages.jsEdit
config.jsonand add this file to thewikidumpfield.
Testing / validation: Use the following command to list the info for all users after the user scrape.
assembla2github.py lsusers
-
Create the GitHub repo.
Edit
config.jsonand set therepofield to value<user>/<repo>. -
Import or push the git repo to GitHub
Testing / validation: Use
assembla2github.py lswikito view and test wiki conversion.
lswiki -q- View all conversion warnings without listing the wiki pageslswiki -B before -A after- Dump all wiki texts into filesbeforeandafterfiles before and after github conversion. Useful for external comparison of the markdown conversion using diff
-
Open the GitHub Wiki page for the repo in a web browser and create dummy first page. Contents and title does not matter.
-
Convert the wiki data
assembla2github.py wikiconvert wikirepo -
The
wikirepodirectory contains the Wiki git repo. Enter the directory, inspect it and push it to GitHubcd wikirepo git push
Testing / validation: Use
assembla2github.py lsticketsto test and view list tickets and test github conversion prior to production conversion. Useful variants:
lstickets -q- View all conversion warnings without listing the ticketslstickets- View all Assembla tickets and ticket events. Options-dand-cwill dump description and comment texts inline.lstickets -g- View all Github issues after conversionlsticket 154- To view specific ticket(s) add them to the command linelstickets -B before -A after- Save all description and comment texts into filesbeforeandafterfiles before and after github conversion. Useful for external comparison with diff
-
Convert the tickets
assembla2github.py ticketsconvert