Hi,
I created a Jira project with a key earlier and later edited the project key. But later when i tries to create a new Jira project with the old project key which was edited and changed I get an error message Project 'ABC' uses this project key.
Is there any solution for this I need to create the new project with the key.
If you really want that you need to clear the old key from project_key table.
We intentionally didn't allow that because then you will break any links from within JIRA or from the outside to issues mentioned under the old key.
If you're afraid of messing with the database (or you can't) you can do another trick - create a new, temporary project (name and key doesn't matter), move issues to that project, remove the original project which will remove also all old keys for it. Then create a project with the key it should have and move back all those issues. Delete the temporary project. Now you're able to create a new project with the key you want.
Hi, according to this document: https://confluence.atlassian.com/display/JIRA/Editing+a+Project+Key
"You won't be able to create a new project with the old project key. However, you can change the renamed project back to the old project key. If you delete the project, all associated keys will be freed and you'll be able to re-use them."
So old keys are still "assigned" to project (because of filters etc.). Currently you can't create new project with the key that was already used.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Michal, is it possible to delete old keys complete from the database and replace them with the new key? Or are new keys just "renaming" the old keys and the internal tracking is still based on the old keys? I am asking this regarding a project import where an old key is colliding with an exisiting key in the new jira instance. Are there options to import this project at all? Cheers, Chris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chris, Please see Pawel's answer in this thread. Cheers, Michal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
EDITED COMMENT
This only worked, because the Project was renamed soon after its creation, so that no edited fields, links or moved items existed under the old project name.
Use Pawels trick with the temporary project to be on the safe side to avoid meddling with the DB.
Hi there
I had the same need and tested Pawels suggestion, which worked.
Database: Oracle 12.1
JIRA: 7.7.1
Here is a step-by-step description:
1) Log into your database and delete the record from the project_key table
-- sql script to delete old project name, so that it can be reused in a new project:
delete
from project_key pk
where project_key = 'MYOLDKEY' -- replace this with your own project key
and (select count(*) from project where pkey = pk.project_key) = 0; -- security check: you don't want to delete the currently active project name
-- commit, if exactly one record was deleted:
commit;
-> this should delete one record exactly, or else you have a mistake in your logic.
2) Restart your Server
-> Note: Reindexing your project doesn't work, as the project key index is not updated in that task.
3) Create your new project in JIRA using the previously deleted project key.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ARGH NO!
You forgot that you must have Jira off line when you do this, and you have only doen part of the job - you've missed the other table you need to change.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you! - I gather you are speaking of the table "changeitem"?
Yes, if you had moved or edited certain item content at the time where the old project-key was active, then you would probably need to edit the records to the new key there.
That didn't apply for us however, because we did the project renaming very soon after creating the project.
I guess the affected items would be:
select * from changeitem
where oldstring like 'MYOLDKEY-%'
or newstring like 'MYOLDKEY-%';
And that still leaves possible links in description and comments open.
In the end Pawels trick with the temporary project is the best solution.
I will edit my original comment as not to mislead other people.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nope, there are other tables involved here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can't believe how many pebbles like this there's in JIRA.... I mean for the price we pay it really shouldn't be THAT MESSY !!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes you will be able to do that, however you will need to create projects manually before importing them. Please make sure you backup your data before changing anything on your instance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So once delete the old project, and create the new project with the key and then from the using project import, I can use both the old and new project.
Am I correct?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.