Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate Issues from Github #809

Closed
matt-h opened this issue Dec 30, 2014 · 38 comments
Closed

Migrate Issues from Github #809

matt-h opened this issue Dec 30, 2014 · 38 comments
Labels
🎯 feature Categorizes as related to a new feature

Comments

@matt-h
Copy link

matt-h commented Dec 30, 2014

Feature Request:
When migrating a repository from Github, it would be great if there was an option to migrate the Issues over as well.

@unknwon unknwon added the 🎯 feature Categorizes as related to a new feature label Dec 31, 2014
@unknwon
Copy link
Member

unknwon commented Dec 31, 2014

Sounds like a great idea!

Could add an option Migrate issues.

@hickscorp
Copy link

+1

@raichu
Copy link

raichu commented Mar 17, 2015

Don't forget bitbucket and gitlab!

@unknwon
Copy link
Member

unknwon commented Mar 17, 2015

@raichu sure!

@fedelibre
Copy link

Another service to consider is Google Code, which went read-only last week. Many projects will need to import their issues.

I wished I found Gogs before.. An open source project I contribute to chose another software (Allura), which is able to import from Google Code.

@fedelibre
Copy link

Anyway, Google Code has an Issue Exporter, which migrate to Github or Bitbucket. I've tested it on Bitbucket and it does a good job. The data dump is text only and the attachments are link to storage.googleapi.com. If Google doesn't delete these files this is a good compromise.

So if you don't develop a specific tool for Google Code, a 2-step migration would be an alternative.

@fedelibre
Copy link

BTW, Allura is the software behind Sourceforge, another service to be considered.

@unknwon unknwon added this to the 0.8.0 milestone Sep 2, 2015
@unknwon
Copy link
Member

unknwon commented Sep 2, 2015

@fedelibre thanks your info!

@fedelibre
Copy link

@unknwon Actually the exporter to bitbucket was not perfect: for example, labels are missing.
I'm now testing the export to github and I've asked to be whitelisted but it still takes some time due to the API rate limit of 5000 reqs/hour.

When you want to work on the importer, let me know if you need the json file of a Google Code project to see the structure of the json file and make a migration test.

@unknwon
Copy link
Member

unknwon commented Sep 2, 2015

@fedelibre

When you want to work on the importer, let me know if you need the json file of a Google Code project to see the structure of the json file and make a migration test.

It would be prefect!

So, Google Code exporter always gives a JSON, right?

@fedelibre
Copy link

You can download it from here.

Tthe data dump is made by Google Takeout. The file format depends on the service chosen and for Google Code there's only JSON, if I remember correctly. It dumps the data of any project you are an owner of. As I'm a member of a single project, there's only one (but lots of issues, more than 4000).

@unknwon
Copy link
Member

unknwon commented Sep 2, 2015

Thanks @fedelibre !

@fedelibre
Copy link

Let me add some comments on Google Code Issue Exporter, in case someone might be interested in the 2-step migration for Gogs.

Migration to Bitbucket

Repository: lilyissues on bitbucket

Pro:

  • all issues imported;
  • same issue IDs as Google Code;
  • quick migration because attachments are not saved to bitbucket server, there's only a link to google servers.

Con:

  • labels missing;
  • attachments are on google servers;
  • some links to attachments are broken.

Migration to Github

Repository: lilyissues on github

Pro:

  • all issues imported;
  • labels saved correctly;
  • attachments are saved on github servers;
  • the migration took 9 hours for a project of 4000 issues and several attachments (you need to be whitelisted by github team to speed up).

Con:

  • issue IDs are different from original ones;
  • some image attachments (stored on github server) are missing.

Overall I think that migration to Github is better than to Bitbucket.
But I hope that Gogs will have a better importer.

@unknwon
Copy link
Member

unknwon commented Sep 3, 2015

@fedelibre I've took a look on Google's JSON, is there any docs describes every field?

@fedelibre
Copy link

I don't think so, I couldn't find anything

@unknwon
Copy link
Member

unknwon commented Sep 3, 2015

OK...

@unknwon
Copy link
Member

unknwon commented Sep 3, 2015

@fedelibre What is the base URL of attachments? I only see attachment ID and filename there...

@fedelibre
Copy link

EDIT: using the same issue number to compare

In this issue I see this link:

https://lilypond.googlecode.com/issues/attachment?aid=44990000000&name=issue.png&token=ABZ6GAcu3dev6rbbq-U6EdUbgpKjKIPqQw%3A1441283851949&id=4499&mod_ts_token=ABZ6GAe-PjZfhWNWxTOxumwwF96bBHkmAg%3A1441283851949&inline=1

However this might not be the real place. If you take a look at this issue imported in bitbucket I find this kind of link:

https://storage.googleapis.com/google-code-attachments/lilypond/issue-4499/comment-0/issue.png

Much better! This seems the real location and the format is clear.

@unknwon
Copy link
Member

unknwon commented Sep 3, 2015

Very helpful!

@unknwon unknwon modified the milestones: 0.7.5, 0.8.0 Sep 3, 2015
@xet7
Copy link

xet7 commented Sep 11, 2015

Hi,
to download GitHub issues, I tried
https://github.com/piwik/github-issues-mirror PHP Symfony command-line
based project that uses GitHub API to download issues as JSON files,
and has PHP-based viewer that has option to show for example 100
issues per page, number 100 is configurable setting. PHP viewer did
not show issue images, but JSON source code seems to have image URLs
pointing to GitHub under https://cloud.githubusercontent.com domain,
so with some script images could be downloaded and changed at source
code. Next steps would be to download images based on info from JSON
files, figure out in what format issues are at Gogs (probably look at
postgres database), and generate script to insert JSON and images as
Gogs repo issues.

But I don't know is this any better that other software some others suggested previously in this issue.

@unknwon
Copy link
Member

unknwon commented Sep 11, 2015

@xet7 thanks your info!

But I think it would be better to directly use GitHub APIs in Gogs.

@xet7
Copy link

xet7 commented Sep 11, 2015

Yes of course.
I don't know is there any other OpenSource software that already has feature to import GitHub issues.

And then, what about importing pull requests? Is there already issue about that?

BR,
xet7

@unknwon
Copy link
Member

unknwon commented Sep 11, 2015

@xet7 Pull Request will not be migrated as far as I think right now.

@unknwon unknwon modified the milestones: 0.7.5, 0.8.0 Nov 15, 2015
@unknwon unknwon modified the milestones: 0.8.0, 0.7.5 Nov 15, 2015
@unknwon unknwon mentioned this issue Nov 26, 2015
3 tasks
@DarthMDev
Copy link

+1000

@cusspvz
Copy link

cusspvz commented Jan 8, 2016

+1

@ghost
Copy link

ghost commented Jan 31, 2016

Team does not currently plan to provide import functions performed by gogs itself?
Since the existence of migrate function, it is recommended to provide through github, Bitbucket, gitlab import function.

issues whether to keep the original author information? gitlab import all responses will be merged into one, it does not feel good within each issues.
However, if the original author to retain new information that will be part of the problem.

@unknwon unknwon removed this from the 0.9.0 milestone Feb 7, 2016
unknwon added a commit that referenced this issue Mar 14, 2016
- Fix go-gogs-client#10
- Related to #809
@unknwon
Copy link
Member

unknwon commented Mar 14, 2016

@ghost
Copy link

ghost commented Apr 25, 2016

It would be nice if I could have API to create issue closed / close it. In https://lolg.it/herby/gh2gogs I can import issues, but all of them are created open.

@unknwon
Copy link
Member

unknwon commented Apr 26, 2016

@Herby good point, miss that!

@ghost
Copy link

ghost commented May 2, 2016

What is ETA on this (and do you think of API to create an issue closed, or to close it, or both)?

@unknwon
Copy link
Member

unknwon commented May 11, 2016

@Herby please try on develop branch or https://try.gogs.io, you can use field "closed": true to set state to closed when create.

@ghost
Copy link

ghost commented May 13, 2016

无闻 wrote:

@Herby https://github.com/herby please try on |develop| branch or
https://try.gogs.io, you can use field |"closed": true| to set state to
closed when create.

Tried on try.gogs.io, it works, with maybe one gltich (as seen in
attachment) - it shows "75 issues" in the badge but only 35 are open -
bug or feature?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#809 (comment)

@ghost
Copy link

ghost commented May 15, 2016

Sorry, no attachment, as I sent the image in email. See https://try.gogs.io/herby/import to find the 75/35 discrepancy.

@unknwon
Copy link
Member

unknwon commented May 24, 2016

@Herby thanks! This is indeed a bug!

unknwon added a commit that referenced this issue May 28, 2016
Add start count corrector for Repository.NumClosedIssues
@unknwon
Copy link
Member

unknwon commented May 28, 2016

@Herby develop branch and demo site are now correct!

It corrects all wrong count at start, so you don't need to do anything to fix old values.

@mathwhiz1212
Copy link

So, how do I import issues from a github repo to a repo in gogs?

@unknwon
Copy link
Member

unknwon commented Jun 26, 2016

@mathwhiz1212 you would have to write a script and call API...

@mathwhiz1212
Copy link

@unknwon That's over my head. I'll wait until it gets implemented.

@unknwon unknwon closed this as completed Aug 25, 2016
ethantkoenig pushed a commit to ethantkoenig/gogs that referenced this issue Feb 11, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🎯 feature Categorizes as related to a new feature
Projects
None yet
Development

No branches or pull requests

9 participants