Import Issues from Jira #8366

Open
opened 2025-11-02 08:03:56 -06:00 by GiteaMirror · 13 comments
Owner

Originally created by @thigg on GitHub (Jan 17, 2022).

Feature Description

It should be possible to migrate issues from jira to gitea.

Currently its possible to import issues from Jira into gitlab and migrate it afterwards into gitea. As of now this unfortunatley does neither migrate comments or attachments into gitlab, thus they cannot be migrated to gitea in turn.

Gitlab mitigates this a bit by linking the original jira issue. This is useful in cases where you have the jira instance left on the network for a while at least.

Thus I propose two things:

  1. Migrate links from gitlab issue titles into gitlab as well
  2. add jira issue import directly into gitea

Screenshots

No response

Originally created by @thigg on GitHub (Jan 17, 2022). ### Feature Description It should be possible to migrate issues from jira to gitea. Currently its possible to import issues from Jira into gitlab and migrate it afterwards into gitea. As of now this unfortunatley does neither migrate comments or attachments into gitlab, thus they cannot be migrated to gitea in turn. Gitlab mitigates this a bit by linking the original jira issue. This is useful in cases where you have the jira instance left on the network for a while at least. Thus I propose two things: 1. Migrate links from gitlab issue titles into gitlab as well 2. add jira issue import directly into gitea ### Screenshots _No response_
GiteaMirror added the type/feature label 2025-11-02 08:03:56 -06:00
Author
Owner

@ivptr commented on GitHub (Dec 5, 2022):

Anybody found a way to migrate Jira issues (with comments and attachments) to Gitea?

@ivptr commented on GitHub (Dec 5, 2022): Anybody found a way to migrate Jira issues (with comments and attachments) to Gitea?
Author
Owner

@lafriks commented on GitHub (Dec 5, 2022):

I think Jira could have so many different customizations that it would be not feasible to implement that into gitea, that should probably be done as external tool to import using gitea api

@lafriks commented on GitHub (Dec 5, 2022): I think Jira could have so many different customizations that it would be not feasible to implement that into gitea, that should probably be done as external tool to import using gitea api
Author
Owner

@ivptr commented on GitHub (Dec 5, 2022):

No need to import customized things.

How about having empty Gitea instance and then use REPLACE INTO SQL statements to populate "issue" and "comment" Gitea tables based on Jira tables? Would that work?

@ivptr commented on GitHub (Dec 5, 2022): No need to import customized things. How about having empty Gitea instance and then use REPLACE INTO SQL statements to populate "issue" and "comment" Gitea tables based on Jira tables? Would that work?
Author
Owner

@lafriks commented on GitHub (Dec 5, 2022):

For basic issue data that could probably work

@lafriks commented on GitHub (Dec 5, 2022): For basic issue data that could probably work
Author
Owner

@ivptr commented on GitHub (Dec 17, 2022):

Please find attached SQL queries to directly migrate issues from Jira to Gitea, including comments, attachments and string based custom fields.

Warning: It deletes all issues, comments and attachments from Gitea. Please read all comments carefully.

migrate_from_jira_to_gitea.txt

@ivptr commented on GitHub (Dec 17, 2022): Please find attached SQL queries to directly migrate issues from Jira to Gitea, including comments, attachments and string based custom fields. Warning: It deletes all issues, comments and attachments from Gitea. Please read all comments carefully. [migrate_from_jira_to_gitea.txt](https://github.com/go-gitea/gitea/files/10251901/migrate_from_jira_to_gitea.txt)
Author
Owner

@achikhv commented on GitHub (Jan 12, 2023):

Here is simple and very dirty tool which I used to import jira issues into gitea's SQL Server database. Should be easy to port other DB servers though.

@achikhv commented on GitHub (Jan 12, 2023): [Here is simple and very dirty tool](https://github.com/achikhv/jira2gitea) which I used to import jira issues into gitea's SQL Server database. Should be easy to port other DB servers though.
Author
Owner

@juangarcia06 commented on GitHub (May 11, 2023):

Using @achikhv tool, I modified it to work with MySQL, I will be publishing it as one of my repositories in the near future. There also is some errors in achikhvs tool I fixed.

@juangarcia06 commented on GitHub (May 11, 2023): Using @achikhv tool, I modified it to work with MySQL, I will be publishing it as one of my repositories in the near future. There also is some errors in achikhvs tool I fixed.
Author
Owner

@delvh commented on GitHub (May 11, 2023):

Once it is published, please add your repo to https://gitea.com/gitea/awesome-gitea#migration.

@delvh commented on GitHub (May 11, 2023): Once it is published, please add your repo to https://gitea.com/gitea/awesome-gitea#migration.
Author
Owner

@achikhv commented on GitHub (May 11, 2023):

Using @achikhv tool, I modified it to work with MySQL, I will be publishing it as one of my repositories in the near future. There also is some errors in achikhvs tool I fixed.

Would love to see PR's with fixes. Could be useful to others.

@achikhv commented on GitHub (May 11, 2023): > Using @achikhv tool, I modified it to work with MySQL, I will be publishing it as one of my repositories in the near future. There also is some errors in achikhvs tool I fixed. Would love to see PR's with fixes. Could be useful to others.
Author
Owner

@juangarcia06 commented on GitHub (May 12, 2023):

Here you have the code, it works fine and documentation is better, hope it helps! https://github.com/juangarcia06/jira2giteaMySql
Was quite a lot of work. I didn't get attachments working. If anyone can get them to work and can make a pull request I would appreciate it a lot since this took me about 2 weeks of work.

@juangarcia06 commented on GitHub (May 12, 2023): Here you have the code, it works fine and documentation is better, hope it helps! https://github.com/juangarcia06/jira2giteaMySql Was quite a lot of work. I didn't get attachments working. If anyone can get them to work and can make a pull request I would appreciate it a lot since this took me about 2 weeks of work.
Author
Owner

@JGKle commented on GitHub (Feb 19, 2024):

Trying out @juangarcia06's importer, but I'm getting 400's (bad request) when it tries to fetch the data from Jira. I'm certain I have the correct login/password in launchSettings.json. However, I am trying to import from a local Jira instance (JiraServer url is http://192.168.5.40:9876). Has anyone else gotten this to work? Any ideas?

Edit: Nevermind, figured it out. For anyone else: the instructions say --JiraFilter searchSomethingInJiraAndGetTheFilterFromTheUrl, but the filter must be numeric. If you have a url like /issues/?filter=allopenissues, you cannot use allopenissues as the jiraFilter. You must re-save it as your own filter, which will then show it as a number, and use that.

@JGKle commented on GitHub (Feb 19, 2024): Trying out @juangarcia06's importer, but I'm getting 400's (bad request) when it tries to fetch the data from Jira. I'm certain I have the correct login/password in launchSettings.json. However, I am trying to import from a local Jira instance (JiraServer url is http://192.168.5.40:9876). Has anyone else gotten this to work? Any ideas? Edit: Nevermind, figured it out. For anyone else: the instructions say `--JiraFilter searchSomethingInJiraAndGetTheFilterFromTheUrl`, but the filter *must be numeric*. If you have a url like `/issues/?filter=allopenissues`, you cannot use `allopenissues` as the jiraFilter. You must re-save it as your own filter, which will then show it as a number, and use that.
Author
Owner

@JGKle commented on GitHub (Feb 19, 2024):

Also for anyone interested: the script can be tweaked to work with sqlite fairly easily:

  • Add reference to Microsoft.Data.Sqlite
  • In Program.cs, create the connection like var sqlc = new SqliteConnection("Data Source=path_to_your_db.db");
  • In importer.cs, replace MySqlConnection with SqliteConnection
  • ...And the ON DUPLICATE KEY UPDATE query with insert or replace into issue_index (group_id,max_index) values ({_repoId},{maxIndex})
  • ...And LAST_INSERT_ID() with last_insert_rowid()
  • ...And insertCmd.LastInsertedId with extension method from here
@JGKle commented on GitHub (Feb 19, 2024): Also for anyone interested: the script can be tweaked to work with sqlite fairly easily: * Add reference to `Microsoft.Data.Sqlite` * In Program.cs, create the connection like `var sqlc = new SqliteConnection("Data Source=path_to_your_db.db");` * In importer.cs, replace `MySqlConnection` with `SqliteConnection` * ...And the `ON DUPLICATE KEY UPDATE` query with `insert or replace into issue_index (group_id,max_index) values ({_repoId},{maxIndex})` * ...And `LAST_INSERT_ID()` with `last_insert_rowid()` * ...And `insertCmd.LastInsertedId` with extension method from [here](https://stackoverflow.com/a/71165552/136785)
Author
Owner

@JGKle commented on GitHub (Feb 19, 2024):

Oh and I just realized: this is importing comments, but not comment counts. i.e. although the comments are actually there, all the issues show a count of 0 comments. And even if you add your own comments to those imported issues, the counts remain as 0.

Looks like the issue is it's not properly setting the issue.num_comments column.

@JGKle commented on GitHub (Feb 19, 2024): Oh and I just realized: this is importing comments, but not comment *counts*. i.e. although the comments are actually there, all the issues show a count of 0 comments. And even if you add your own comments to those imported issues, the counts remain as 0. Looks like the issue is it's not properly setting the `issue.num_comments` column.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8366