mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-12 18:48:08 -05:00
Import issues from Bugzilla #3754
Open
opened 2025-11-02 05:24:12 -06:00 by GiteaMirror
·
9 comments
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7
v1.16.6
v1.16.5
v1.16.4
v1.16.3
v1.16.2
v1.16.1
v1.16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1.3.2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
No Label
type/proposal
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#3754
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @argv-minus-one on GitHub (Aug 8, 2019).
[x]):Description
Please add support for importing issues from Bugzilla.
Note that Bugzilla is often used to track issues for many different projects in one place, whereas Gitea/GitHub-style issue tracking has a separate issue tracker for each project. A Gitea importer would need to be able to select which Bugzilla “product” to import issues for.
@argv-minus-one commented on GitHub (Aug 8, 2019):
It would also be preferable if Gitea could import from Bugzilla XML output, without contacting a Bugzilla instance directly. That way, Gitea won't need to deal with authenticating itself to Bugzilla, which may require a client certificate, Kerberos/Active Directory ticket, or the like.
@mrsdizzie commented on GitHub (Aug 9, 2019):
I think this would be pretty low priority if being honest, as most migrations are centered around github at the moment (and in the future probably similar services with similar APIs).
If you are looking to do this yourself, you could probably try and script it from the BugZilla XML export. This is an older script that took data from BugZilla and put it into Github.
https://github.com/erikmd/github-issues-import-api-tools/blob/master/attic/bugzilla2github
And perhaps some more information here:
https://www.theozimmermann.net/2017/10/bugzilla-to-github/
As a starting point for how somebody else did something similar
@argv-minus-one commented on GitHub (Aug 9, 2019):
@mrsdizzie I can indeed do that, except that there's currently no way in the API to preserve the issue numbers, and @lunny thinks it would be a bad idea to add a way, because issue migration should be built into Gitea instead. That's why I opened this issue.
As you say, Gitea's migration code seems designed for migrating Git repositories and associated data from GitHub-like sites. It would need a pretty major redesign to handle migrating anything else, such as issues from a separate issue tracker like Bugzilla. That's why I posted #7790: it would be a much simpler change, and allow people like me to write external issue-migration tools without having to make such drastic changes to Gitea itself.
With you apparently disagreeing with @lunny, I'm now at a loss as to what to do. Should I insert issues through Gitea's API and then change the issue numbers (with
UPDATE issue SET `index` = ? WHERE `id` = ?) in the database directly? That seems to work, but will it break anything?@mrsdizzie commented on GitHub (Aug 9, 2019):
I don't disagree with Lunny or have any particular opinion other than I wouldn't expect somebody else to add this migration code to Gitea anytime soon if you were hoping the issue would result in that.
Given that I was just pointing to a script of somebody who did something similar with Github which has the same limitations on not allowing setting an issue number via API.
@guillep2k commented on GitHub (Aug 10, 2019):
Have you checked the "external issue tracker" option? I don't know what it does, but sounds interesting:
(Available at Repository Settings)
@argv-minus-one commented on GitHub (Aug 11, 2019):
@mrsdizzie Ok, fair enough. Would you happen to know if changing the issue numbers in the database after they're created (with the API) will break anything?
@guillep2k Yes, I saw that. That is an option, but I was hoping to migrate the issues into Gitea, because Bugzilla is rather slow and much less user-friendly than Gitea.
@guillep2k commented on GitHub (Aug 11, 2019):
@argv-minus-one You need to update all the other related tables (
attachment,issue_assignees,issue_watch,issue_dependency,issue_user,reaction,stopwatch,tracked_time,pull,review) to reflect the changes. But you'll probably have no rows in many of them if you've just created the issues. Disclaimer: I've just made a crude search through the source code to get the list; it may not be complete.@jpicht commented on GitHub (Aug 11, 2019):
@argv-minus-one Two things:
@argv-minus-one commented on GitHub (Aug 13, 2019):
@jpicht
Here's one from Mozilla's Bugzilla instance.
Here's the XML DTD from Mozilla's Bugzilla instance. Note that the DTD varies from instance to instance, because it reflects whatever custom fields are configured in the Bugzilla instance. Here's a Gist containing the DTD from my Bugzilla instance, which doesn't have any custom fields configured.
Yes.
I'd prefer to be able to upload the XML from my browser, instead of Gitea pulling it directly from a running Bugzilla instance, for two reasons:
I need to edit the comments in Bugzilla. Besides Bugzilla, I am also preparing to migrate from Mercurial to Git, and some of the comments in Bugzilla talk about Mercurial commit identifiers. These need to be rewritten to the corresponding Git commit identifiers, and the simplest way to do that is by editing the XML before handing it off to Gitea.
In my Bugzilla instance, user names are email addresses, and that's what appears in the XML. I need to rewrite them to Gitea user names. Again, the simplest way to do that is by editing the XML.
In the longer term, it would be ideal if Gitea could migrate issues (and perhaps other kinds of data) into existing repositories as well. However, I understand that Gitea's current design doesn't allow for this.