If I rename a project, then import the project into another JIRA instance, I can't do any operations using the old project.
For example, I cannot search for issues in the project, using the old project key.
If you import a renamed project, it doesn't retain the history of old project keys. This means that operations using the old project key won't work.
For example, if you rename a project from CAT to DOG, you normally can search for an issue (e.g. DOG-123) by using the old project key (e.g. CAT-123).
If you want to keep this information when importing the project to another JIRA instance, you will need to do the following:
Just to add on a note to Andrew's answer, that moved_issue_key table links old issue keys to their issue IDs. The high chance is that, upon a project import, the issue IDs are no longer the same as in the source instance, causing the links to be incorrect. Because of this, one should not simply copy the contents of this table from the source to destination database. It's advised that correct issue IDs are manually identified, by running a query like this in the destination database (using the new issue key e.g. DOG-123):
SELECT id,issuenum,project,reporter,assignee,creator,summary,description FROM jiraissue where issuenum = 123 and project = (select id from project where pkey = 'DOG');
The correct issue ID of DOG-123 will be identified, and that ID should be linked to the old issue key (CAT-123) in moved_issue_key table.
Even if this issue is almost 2 years old it helped me a lot when I had to perform this task. Since there are some aspects missing I just want to share my experience with you all.
There's no guarantee that it'll work for you. Assumptions: The project key of the old project is OLD and it is about to be changed to NEW
select concat('INSERT INTO [dbo].[project_key] VALUES (',[ID],',',[PROJECT_ID],',''',[PROJECT_KEY],''');') from [project_key] where [PROJECT_KEY] = 'OLD' -- Replace OLD according to your project key
Insert the former issue keys in the table moved_issue_key for the automatic redirection mentioned by @Andrew Lui. I used this statement.
INSERT INTO [dbo].[moved_issue_key] ([ID] ,[OLD_ISSUE_KEY] ,[ISSUE_ID]) SELECT coalesce(const.maxs, 0) + row_number() OVER (order by (select NULL)) ID ,('OLD-' + cast(issuenum as varchar(5))) as issue ,[ID] as ISSUE_ID FROM [dbo].[jiraissue] cross join (select max(ID) as maxs from [dbo].[moved_issue_key]) const where [PROJECT]=(select ID from [dbo].[project] where pkey = 'NEW')
It's definately a good idea to test the select in advance to check if the result is plausible. You have to replace "OLD-" by your old key and don't forget the trailing "-" as well as NEW has to be replaced by your new project key (no "-").
This is not enough because JIRA remembers a sequence number for the ID of this table and doesn't know about the new rows. As a result the next move would cause a primary key collision. Therefore the value of MovedIssueKey in the table SEQUENCE_VALUE_ITEM has to be set greater than
select MAX(ID) FROM [dbo].[moved_issue_key]
JIRA sets this number always to the next value roundet up to 100. (e.g. 12345 gets 12400)
This worked for me using JIRA 7.1.6. There may be circumstances I currently not see that might break this process but it worked for me this way.
Hope this helps
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot