I recently migrated SEP from using an old crusty version of gitorious, to a new shiny version of gitlab.
Overall, it was a pretty smooth process, here’s a chronicle of some of the events, and some things to think about/look out for when doing a tool migration like this.
There are two logical steps for a migration effort like this. Export, and then Import. Usually I’d use an API for the export, but the version of gitorious we were on didn’t have a documented API. So, I made a script, and loaded it into a rails console. BAM: Instant API.
Once you’re on the gitorious machine, it looks something like this:
$ cd /var/www/gitorious
$ sudo script/console production
$ load '~/gitorious-export/export.rb'
Here’s the script in all it’s glory: https://github.com/sep/gitorious-export/blob/master/export.rb
It does 3 things:
Now, gitlab has a pretty decent looking API, and a ruby gem to go with it… so this should be easy, right?
Well, sort of.
The API has all the things I needed. The API, however, has some shortcomings in it’s non-happy-path scenarios.
Namely: ALL NON-HAPPY-PATH SCENARIOS RETURN 404 NOT FOUND.
WTF?
Anyways, given the completeness of the gitlab API, it was relatively easy to complete the several logical steps:
Here is the code for the importer… it’s a little less hackety than the exporter since I could use a real API. https://github.com/sep/gitlab-import
As with any widespread change that’s going to affect the rest of the company… there’s a couple other things to do. Test, Test, Test and Spread the word.
I tested this thing OVER and OVER until I knew it would be flawless. This took hours (exporting years worth of data from the gitorious and loading into a VM running gitlab), but it would be worse if a single developer couldn’t work for a couple hours because I screwed something up.
Spreading the word is easy… just send out a couple company wide emails, and all is cool. (Hint: Engineers don’t read email.)
Things I thought about:
Things I didn’t think about:
git://whatever.org/repo.git
).