28

Recently, we decided to migrate our projects from GitHub to BitBucket. For now, I tested with few projects as BitBucket has direct import feature. Everything is just fine, except GitHub issues, and wikis are not imported. Since most of the projects are still in development and some in production, issues, and wikis are important for us.

I did quick Google search and could not find proper solution.

Is there any solution?

double-beep
  • 5,031
  • 17
  • 33
  • 41
chhantyal
  • 11,874
  • 7
  • 51
  • 77

7 Answers7

24

Today we added proper issue import and export to Bitbucket. You can export an entire repo's issue tracker as a zip and then re-import on a different repo.

You can also create your own zips and so you could write very migration scripts to and from other issue trackers (e.g. GitHub).

Details: https://confluence.atlassian.com/display/BITBUCKET/Export+or+Import+Issue+Data

File format and data layout: https://confluence.atlassian.com/pages/viewpage.action?pageId=330796872

Erik van Zijst
  • 2,282
  • 2
  • 17
  • 14
  • 2
    Links or examples about how to create such archive from github's data will be very helpful here. – Ivan Anishchuk Aug 14 '14 at 11:21
  • Here you go... This post shows how to do it very simply: http://codetheory.in/export-your-issues-and-wikis-from-github-repo-and-import-to-bitbucket-migration/ – infinite-loop May 29 '15 at 23:29
13

I was also searching for a way to import Github issues to Bitbucket but didn't find one, so I wrote a script to do that: https://github.com/sorich87/github-to-bitbucket-issues-migration.

For the wiki, it's a Git repository that you can simply clone. https://github.com/blog/699-making-github-more-open-git-backed-wikis

sorich87
  • 871
  • 10
  • 8
  • 1
    It seems to be broken: /usr/lib/ruby/vendor_ruby/json/common.rb:155:in `initialize': A JSON text must at least contain two octets! (JSON::ParserError) from /usr/lib/ruby/vendor_ruby/json/common.rb:155:in `new' from /usr/lib/ruby/vendor_ruby/json/common.rb:155:in `parse' – Guy Korland Mar 03 '13 at 16:35
11

Both github and bitbucket have REST APIs for issues (GitHub's, Bitbucket's), so you could write a (fairly) quick script to migrate issues. However, GitHub has no API for wikis (Bitbucket does), so, unfortunately, you'll likely have to do that by hand.

Rafe Kettler
  • 75,757
  • 21
  • 156
  • 151
  • 10
    Regarding API for wiki, GitHub wiki is also a [Git repository](https://github.com/blog/699-making-github-more-open-git-backed-wikis). You can `git clone` it, process it and push it to Bitbucket via Bitbucket's API. – uzyn Jul 27 '12 at 06:44
3

This is the step by step version of Erik van Zijst's resources:

http://codetheory.in/export-your-issues-and-wikis-from-github-repo-and-import-to-bitbucket-migration/

It shows step by step how to do it. Hopefully this will save you some time.

I was able to import all my Github issues into BitBucket!

infinite-loop
  • 882
  • 11
  • 17
1

There is another tool, written in python, for exporting github issues into bitbucket issues export format.

You can check it at gibiexport

kikeenrique
  • 2,589
  • 2
  • 25
  • 46
0

I was having the same issue, so I wrote a Python script to help my team migrate our issue data from GitHub to BitBucket: https://github.com/Brethren-Studios/issue-migrator

This script outputs the issue data in a BitBucket-friendly JSON format. As Erik van Zijst specified up above, Atlassian has documentation for importing/exporting BitBucket issue data and the data format required for importing to BitBucket.

Evan Williams
  • 164
  • 1
  • 5
-5

Here's the easiest solution I have found:

cd $HOME/dev/Pipelines
git remote rename origin bitbucket
git remote add origin https://github.com/edwardaux/Pipelines.git
git push origin master

And when you're happy with Github and don't need the old remote:

git remote rm bitbucket
user3342048
  • 55
  • 1
  • 10
  • 3
    But this doesn't migrate issues nor wikis. It's usually a bit more complicated than migrating code. – Ivan Anishchuk Aug 14 '14 at 11:04
  • Also as for your particular script: 1) the question was about migration from github to bitbucket, not vice versa; 2) it won't migrate tags and, sometimes, branches (you have to pull and push them explicitly, `push --all` and `push --tags` being helpful). – Ivan Anishchuk Aug 14 '14 at 11:08