Hi Martin,
You beat me to it: I was working on exactly the same stuff with the same
tools :)
Raff
On Jul 30, 2015 6:18 PM, "Martin Holmes"
Hi all, especially Raff, our migration manager.
I just migrated my project from SF to GitHub in the following steps:
=== 1. PREPARATION ===
Do a freeze (not a problem for my tiny project).
Make sure you have complete backups and checkouts.
Prepare a JSON file called users_sf2gh.json which consists of the equivalent user names from SF and GitHub, like this:
{ "martindholmes" : "martindholmes", "stadlerpeter" : "peterstadler" }
(Obviously this needs a bit of research.)
=== 2. GETTING TICKETS ETC. OUT OF SF ==========================
Do a full export of the SF project from here:
https://sourceforge.net/p/[proj]/admin/export
This is not instant; you'll get an email when it's complete and you can download it as a zip. That produced these files for me:
admin.json discussion.json tickets.json wiki.json
It doesn't include the code, of course.
=== MOVING CODE TO GITHUB =====================================
Go here:
https://import.github.com/new/
and follow the instructions to import your code. This was quick for my tiny project, but would take a long time for the TEI codebase. The commit history is preserved correctly, as far as I can see. I provided the https URL for the SF repo:
https://svn.code.sf.net/p/[proj]
While that's going on, or after it's finished, you're offered the option to provide the list of SF/GitHub user equivalences you've already specified in the JSON file, through a web form (you'll use the JSON file itself later, when importing tickets).
=== MOVING TICKETS TO GITHUB =================================
I used this PERL script for this:
https://github.com/cmungall/gosf2github
Beware: there is a typo (occurring in two places) which omits a quotation mark in the example; I've added a patch and sent a pull request to fix it.
There are several stages to this:
1. Set up an OAUTH token for the Git repo here:
https://github.com/settings/tokens
2. Get a list of the project collaborators in JSON format from github like this:
curl -H "Authorization: token YOURTOKEN" https://api.github.com/repos/[entity]/[project]/collaborators > [project]-collab.json
3. Run the PERL script, which pulls down each ticket from SF and pushes it up to GitHub -- this is my command line:
perl gosf2github.pl -a martindholmes -u users_sf2gh.json -c codesharing-collab.json -r martindholmes/CodeSharing -s codesharing/tickets -t [MYTOKEN] tickets.json
You can run it with the -k flag first to do a dry-run and see the curl statements that would be addressed to github without sending them.
This successfully imported the two tickets I had created as a test, one open and one closed, with embedded XML code successfully preserved.
Hope this helps. It's nice to be on vacation. There's time to actually do stuff. :-)
Cheers, Martin
-- tei-council mailing list tei-council@lists.tei-c.org http://lists.lists.tei-c.org/mailman/listinfo/tei-council
PLEASE NOTE: postings to this list are publicly archived