sorich87 / github-to-bitbucket-issues-migration Goto Github PK
View Code? Open in Web Editor NEWMigrate issues from a Github repository to a Bitbucket one
Migrate issues from a Github repository to a Bitbucket one
I am getting following parse error when retrieving issuer:
705 retrieved
Processing issue 8
Status:
Priority: minor
Type:
Milestone:
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/json/common.rb:148:in parse': 743: unexpected token at 'Resource not found' (JSON::ParserError) from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/json/common.rb:148:in
parse'
from /Users/knyttl/Downloads/github-to-bitbucket-issues-migration/migration.rb:193:in open_issue' from /Users/knyttl/Downloads/github-to-bitbucket-issues-migration/migration.rb:91:in
upload_issue'
from /Users/knyttl/Downloads/github-to-bitbucket-issues-migration/migration.rb:68:in block in upload_issues' from /Users/knyttl/Downloads/github-to-bitbucket-issues-migration/migration.rb:68:in
each'
from /Users/knyttl/Downloads/github-to-bitbucket-issues-migration/migration.rb:68:in upload_issues' from /Users/knyttl/Downloads/github-to-bitbucket-issues-migration/migration.rb:19:in
perform!'
from cli.rb:4:in `
I'm running through the .jason output and I'm not seeing any of the "closed" issues. Is this possible with a special option?
Awesome piece of code by the way, thank you!
I run this command in bash:
$ ruby cli.rb -t 'personal_gh_access_token' -u 'gh_username' -p 'gh_password' -o 'export_filename.zip' -r 'gh_username/repo'
where is personal_gh_access_token
created at this URL: https://github.com/settings/tokens. It is called "git: https://github.com/ on HOPE-PC at 23-oct.-2016 13:35" and it was regenerated by me today with all the available permissions enabled.
The output of the command is this (it is the same as running it with sudo
):
Fetch gh_username/repo
Error fetching data from github GET https://api.github.com/repos/gh_username/repo/issues?page=1&state=open: 401 - Must specify two-factor authentication OTP code. // See: https://developer.github.com/v3/auth#working-with-two-factor-authentication
This is either a bug, or an undocumented behavior. If I disable the two-factor authentication on my GitHub account, everything works well.
Got this error when attempting to use this.
c:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:923:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (Faraday::SSLError)
from c:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:923:in `block in connect'
from c:/Ruby22-x64/lib/ruby/2.2.0/timeout.rb:74:in `timeout'
from c:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:923:in `connect'
from c:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:863:in `do_start'
from c:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:852:in `start'
from c:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:1375:in `request'
from c:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:1133:in `get'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:80:in `perform_request'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:40:in `block in call'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:87:in `with_net_http_connection'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:32:in `call'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/response.rb:8:in `call'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/response.rb:8:in `call'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/rack_builder.rb:139:in `build_response'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/connection.rb:377:in `run_request'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/connection.rb:140:in `get'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sawyer-0.6.0/lib/sawyer/agent.rb:94:in `call'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/octokit-3.8.0/lib/octokit/client.rb:339:in `request'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/octokit-3.8.0/lib/octokit/client.rb:200:in `paginate'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/octokit-3.8.0/lib/octokit/client/issues.rb:31:in `list_issues'
from c:/Users/James/github-to-bitbucket-issues-migration/lib/github-to-bitbucket-issues/downloaders/base.rb:17:in `block in fetch'
from c:/Users/James/github-to-bitbucket-issues-migration/lib/github-to-bitbucket-issues/downloaders/base.rb:15:in `loop'
from c:/Users/James/github-to-bitbucket-issues-migration/lib/github-to-bitbucket-issues/downloaders/base.rb:15:in `fetch'
from c:/Users/James/github-to-bitbucket-issues-migration/lib/github-to-bitbucket-issues/export.rb:105:in `download_all_of'
from c:/Users/James/github-to-bitbucket-issues-migration/lib/github-to-bitbucket-issues/export.rb:92:in `block in download_issues'
from c:/Users/James/github-to-bitbucket-issues-migration/lib/github-to-bitbucket-issues/export.rb:91:in `each'
from c:/Users/James/github-to-bitbucket-issues-migration/lib/github-to-bitbucket-issues/export.rb:91:in `download_issues'
from c:/Users/James/github-to-bitbucket-issues-migration/lib/github-to-bitbucket-issues/export.rb:51:in `block in generate'
from c:/Users/James/github-to-bitbucket-issues-migration/lib/github-to-bitbucket-issues/export.rb:38:in `each'
from c:/Users/James/github-to-bitbucket-issues-migration/lib/github-to-bitbucket-issues/export.rb:38:in `generate'
from cli.rb:51:in `<main>'
$ ruby -v
ruby 2.2.2p95 (2015-04-13 revision 50295) [x64-mingw32]
Example exported file: export_filename.zip. In the resolved issue called "Application crashed" the bug is obvious because the issue was created after the issue comment in it. The dates are different.
I've only changed the names of users and repos to generic one, but while I run this command, I use real username and repo names, and error is below:
Thanks if you can fix this issue.
cli.rb:1:in `require': ./migration.rb:33: syntax error, unexpected ':', expecting ')' (SyntaxError)
login: @github[:username],
^
./migration.rb:34: syntax error, unexpected ':', expecting '='
password: @github[:password]
^
./migration.rb:35: syntax error, unexpected ')', expecting kEND
./migration.rb:42: odd number list for Hash
@history[@github_repo] = {issue: {}, comment: {}}
^
./migration.rb:42: syntax error, unexpected ':', expecting '}'
@history[@github_repo] = {issue: {}, comment: {}}
^
./migration.rb:54: odd number list for Hash
state: state,
^
./migration.rb:54: syntax error, unexpected ':', expecting '}'
state: state,
^
./migration.rb:55: syntax error, unexpected ':', expecting '='
page: page,
^
./migration.rb:56: syntax error, unexpected ':', expecting '='
direction: 'asc'
^
./migration.rb:57: syntax error, unexpected '}', expecting kEND
})
^
./migration.rb:86: syntax error, unexpected ':', expecting ')'
status: get_issue_status(issue),
^
./migration.rb:86: syntax error, unexpected ',', expecting kEND
./migration.rb:87: syntax error, unexpected ',', expecting kEND
./migration.rb:89: syntax error, unexpected ':', expecting '='
content: content,
^
./migration.rb:90: syntax error, unexpected ':', expecting '='
kind: get_issue_kind(issue),
^
./migration.rb:90: syntax error, unexpected ',', expecting kEND
./migration.rb:92: syntax error, unexpected ')', expecting kEND
./migration.rb:165: odd number list for Hash
content: content
^
./migration.rb:165: syntax error, unexpected ':', expecting '}'
content: content
^
./migration.rb:189: odd number list for Hash
body: attributes,
^
./migration.rb:189: syntax error, unexpected ':', expecting '}'
body: attributes,
^
./migration.rb:190: syntax error, unexpected ':', expecting '='
basic_auth: @bitbucket
^
./migration.rb:193: syntax error, unexpected ':', expecting ')'
body = JSON.parse(response.body, symbolize_names: true)
^
./migration.rb:201: odd number list for Hash
body: attributes,
^
./migration.rb:201: syntax error, unexpected ':', expecting '}'
body: attributes,
^
./migration.rb:202: syntax error, unexpected ':', expecting '='
basic_auth: @bitbucket
^
./migration.rb:205: syntax error, unexpected ':', expecting ')'
body = JSON.parse(response.body, symbolize_names: true)
^
./migration.rb:208: syntax error, unexpected $end, expecting kEND
from cli.rb:1
Issues are not copied with their original ID, which means that correlation between issues and a source will be broken.
At this point, it displays an error if milestones don't exist on Bitbucket and you need to create them manually. It would be good if they were created via the API.
The json export file only defines milestone names that appear against open issues.
It would be helpful if the milestone values for closed issues could also be included in the json.
Depending on the number of milestones you have it may be a simple enough workaround to add these to the bottom of the unzipped json file before re-zipping it for import (I happen to have 68 closed milestones).
It's the default on widely used systems like OS X and CentOS an supporting it is very small work (only hash syntax change I think).
Allow setting a list of usernames to match between Github and Bitbucket
We've added proper issue import and export to Bitbucket. You can export an entire repo's issue tracker as a zip file 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
-r
option must in in format user/repo (I guess it's an effect of some underlying library changes)
-r user/repo
one has to create a dir (side effect of changing -r option format?):
mkdir user
It contains (https://confluence.atlassian.com/display/BITBUCKET/Export+or+Import+Issue+Data)[Bitbucket Issue Data Format]
: (link)[description]
while correct markdown is [description](link)
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.