In my previous blog From Assembla to GITHub – Phase 1: Migrate your SVN repository to GIT I explained how to migrate your SVN repository to GIT and commit it to GITHub.
In this blog I will give some information on how to migrate Assembla issues into your GITHub repository, without losing any data.
A PHP Web server to run the script
Chapter 1 – Export data from Assembla
From your Assembla console, Tickets->Settings->Export & Import and Export your tickets, this will generate a bak file (they say it is a JSON, but basically is text file with some JSON structure)
Chapter 2 – Import bak file into your GITHub repository
Here comes the fun… There is no easy way to import this file in GITHub, but they have very powerful REST services.
So, I decided to create a PHP script that parses the export file from Assembla and import to GITHub using their services. GITHub has no official API for PHP, but there are several GITHub repositories that are creating them.
I decided to use github-php-client, that, IMHO, has a great structure and flexibility. Unfortunately, these APIs are not fully compliant with the version 3 of GITHub services.
No fear! Is it an open source project? OK, let’s collaborate…
I created a fork of that project and I completed the API fixing the missing pieces for my scope (currently most of my changes have been included into the master, otherwise you can use my fork).
Then a simple PHP script will do the dirty job… The code is shared as open source here.
After few minutes all the issues, comments and milestones were imported into my new GITHub repository!
Note Before starting the import of the file I suggest to test the export file in a dummy project, only after this test I would suggest to try on your official GIT repository. I have no responsibility on the use of this script.