Code Monkey home page Code Monkey logo

bitbucket-issues-to-github's Introduction

Bitbucket Issues to GitHub Script

A LINQPad script to migrate issues from Bitbucket to a GitHub repository.

Features

  • Imports the issues, comments, and actions from the original bitbucket issues
  • Closes issues that were marked closed it bitbucket (or marked duplicate/invalid/etc.) - configurable
  • Allows replacing users with the corresponding github users
    • Note: all actions will be added to github as being created the github user running the script - however text/comments are added to denote who originally created the issue/comment.

What does the end result look like? Take a look at NUnit.ApplicationDomain early issues, specifically as an example, see issue #1

Missing Features

  • Does not import attachments or images; PRs welcome

Steps

Here's a warning:

Warning

It's highly suggested that you test importing into a scratch/private repository before importing into a live repository; this will allow you to verify it works and adjust as needed before performing the final import

  1. Export the issues from Bitbucket repository into a json file
    1. Navigate to the repository settings
    2. Navigate to Import & export under the Issues section in the sidebar
    3. Click Start Export
    4. When it's completed, download the zip, and extract the files to a known location
  2. If you don't already have LINQPad installed, go install it; it's free and a great tool for .NET developers
  3. Download the ImportFromBitbucket.linq script in this repository
  4. Open the script in linqpad
  5. Configure the script as needed (see below)
  6. Run the script using F5 or the green play button

Configuration

Basic Options

Most of the configuration is straightforward - you'll need:

  • the path to the exported bitbucket json (in 2.0 format)
  • the name of the owner of the github repository
  • the name of the github repository
  • the url of the original bitbucket repository - to enable links back to the original

Additionally, you'll need a personal access token; this isn't specified in the script - it's retrieved via Util.GetPassword - but LINQPad will prompt you for it. You can create a token via the Personal access tokens page on github; feel free to delete the token after you're done importing.

Note: "Machine Account" user for issues

Since all issues are created from the account of the personal-access-token, you may wish to create a secondary "machine account" for the purposes of importing issues; per the link provided, this is totally okay by GitHub, and IMHO makes it much more clear that the issue was imported rather than native.

Closed Status

GitHub only has open or closed issues, while bitbucket has much more rich statuses like "duplicate", "invalid" etc. You can specify the statuses that indicate that an issue is "closed".

Mapping Users

The original author of an issue/comment/action is listed in each comment. By default the original author's display name is set as the author; for example if I had commented on an issue, it would show up as "Mackenzie Zastrow commented". If you instead want to map "Mackenzie Zastrow" to @zastrowm", you can do that using the userMapping dictionary, after which, the text would show up as "@zastrowm commented".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.