What is the best way to migrate users from Crucible to Jira?

Mike Hedman June 5, 2013

Hi,

We have been using FishEye/Crucible for a while, and have recently added Jira. I would like to only have one list of users (which I presume will be in Jira). My question - is there a way that I can migrate those users to Jira in a way that their Crucible accounts are not affected (that is, I would prefer to not just delete them all and re-enter them in Jira, as I'm concerned their history and preferences in Crucible would be lost).

Thanks,
Mike

4 answers

1 accepted

0 votes
Answer accepted
Foong
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 9, 2013

Hi Mike,

Use the following SQL command to get the list of users in FishEye:

SELECT cru_user_name,cru_email FROM cru_user WHERE cru_fisheye_enabled = (1);

Create Jelly script to add the users into JIRA

<JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.JiraTagLib">
<jira:CreateUser username="new-user" password="password" confirm="password"
fullname="Full name" email="test@test.com"/>
</JiraJelly>

After adding all the users into JIRA, integrate JIRA into FishEye for user management at Administration > Security Settings > Authentication. Do not enable synchonization or synchronize the user as this will create duplicate users in FishEye (One using FishEye authentication, one using JIRA authentication).

Stop Fisheye and run the following script to change all the current users in FishEye to use JIRA for authentication:

UPDATE cru_user SET cru_authtype = 6;

Restart FishEye and confirm all the users in FishEye is working correctly before enabling JIRA user synchonization in FishEye.

that is, I would prefer to not just delete them all and re-enter them in Jira, as I'm concerned their history and preferences in Crucible would be lost

Yes, deleting the user will lose the history and preference. Do not delete the users.

Foong
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 13, 2013

As you can see from this answer, the next step is to add JIRA into FishEye for user management and do not synchronize the users.

0 votes
Mike Hedman June 28, 2013

Sorry for the long delay in responding - I wanted to make sure everything was working properly. And it is!

Thanks for the solution.
Mike

0 votes
Mike Hedman June 13, 2013

I think I figured it out. The 'enabled' fields are of the 'bit' type. So the proper where clause for active users should actually be: where cru_fisheye_enabled = (1)

To find inactive users, it would be: where cru_fisheye_enabled = (0)

In fact, these two where clauses return the same results:

where cru_fisheye_enabled = 'true'

where cru_fisheye_enabled = 'false'

Both of these evaluate the same as when using where cru_fisheye_enabled = (0)

By using the query I did, it generates a set of "CreateUser" commands using the original Crucible usernames, so that's how I'm making sure the names are the same.

Hopefully today the IT guys will run the Jelly script, I'll let you know how it goes.

Thanks!

Mike

Foong
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 13, 2013

Edited the original answer

Foong
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 13, 2013

Sorry for my mistake. It is showing in my DbVisualizer as 'true' and I forget to check its data type.

0 votes
Mike Hedman June 13, 2013

Hi,

Thanks for the reply. We are working on it here. I had to do cru_fisheye_enabled != 'true' to get my regular users. Doing = 'true' only gave me the two users who I had deleted earlier. Odd.

Anyhow, for what it's worth, here's the query I used to generate the CreateUser lines:

select concat('<jira:CreateUser username="', cru_user_name, '" password="password" confirm="password" fullname="', cru_displayname, '" email="', cru_email, '"/>')  from cru_user WHERE cru_fisheye_enabled != 'true' into outfile '/tmp/users4.txt';

I'll let you know how the next steps go.

Mike

Foong
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 13, 2013

Make sure that you have the same username for the users in FishEye and JIRA

Foong
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 13, 2013

That's weird. If cru_fisheye_enabled is not true then it will not be shown in FishEye. Those users should be the one that have been deleted in FishEye.

Suggest an answer

Log in or Sign up to answer