I would like to perform a full restore in Jira BUT the usernames need to changed from full email addresses to only the username portion of the email address.
For example, johndoe@mycompany.com would become johndoe
I see in entities.xml there are lines beginning with <User id= that contain userName and lowerUserName keys, but user name (and user key) seem to appear all over the file.
Is it possible to do what I've described above, and if so... how?
Dear @Rob Horan ,
yes, you can do - you need to replace the old username in some other places. Be aware not to change the emailAddress.
I have done this in the past for a larger project where 2 Jira instances got merged. Beside usernames, I also had to change issue types, statuses, custom fields, resolutions and link types. It worked like a charm, once you understand the logic in the XML file.
Anyhow, when restoring the dump in a sandbox environment, you will see if it works or not.
So long
Thomas
So, just to be clear, I can run a replace on:
and this would be OK?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Better, before the entire replace, check manually a couple of XML elements that references the 'username' and not the ID. Then you are save.
In Jira's XML backup file the 'username' is used in other places. Eg. for the entity "project" and its property "lead", there you will find the 'username' and not it's id.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well,that's why I'm asking for help.i appreciate the advice, don't get me wrong, but I was hoping for a definitive set of patterns to use for search and replace.
I'm somewhat surprised this hasn't been documented on the community yet.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear @Rob Horan ,
the reason for that there is no 'official' documentation is the risk that you break your system or it get's unstable when the modifications of the XML are not successful.
Therefore it is very important to perform a dry-run before doing this for a production environment.
To better understand the XML file format (no fear - its no rocket science), I recommend to create a new empty instance, create 5 users, a couple of issues with comments and attachments and modify them with those 5 users. Then export to XML and change the username of one user and restore. This should take you not too long, but you will know where the pitfalls are.
So long
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, I don't mean docs from Atlassian :) But I figured someone in the community would have documented it.
If I get to do this I'll see if I can place a comprehensive reply here as a reference to others.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great! Please write an article afterwards, to share your xp and link it with this question.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.