Hi all,
I recently went through a migration of Bitbucket from one application server to another (using this guide https://confluence.atlassian.com/bitbucketserver/migrating-bitbucket-server-to-another-server-776640406.html). The underlying SQL server and the DB were unchanged, I simply changed the connection string on the new server to reference the existing DB. My Bitbucket version is 4.8.3.
After the services were started on the new server after the final data migration I was unable to log in with a user from the Jira directory - the error in atlassian-bitbucket.log was 'JIRA User Directory' is not functional during authentication'. I have seen that this appears to be a known issue and that logging in locally and resetting the Jira directory config does the trick. Which leads me on to my main problem: I wasn't able to log in with a local user. I tried running through the process to generate a recovery password but I ended up having issues with the BITBUCKET_HOME environment variables and was under time pressure to roll back.
What I wanted to know is how I confirm that my local users are configured correctly before re-trying a migration. The user in question has the sys admin and admin global permissions as per the kb, however I notice that it is defined as a 'Stash Internal Directory' user. My understanding is that Stash is legacy now so is there an issue there? My DB is also named 'Stash'. I would also like to understand my DB schema and if there are any areas to check user definitions and permissions within.
I am happy to answer any further questions, I don't want to keep typing endless background info! Thanks in advance.
Hello Sam, So it seems you have several issues here.
The $BITBUCKET_HOME is key. You really need to make sure that $BITBUCKET_HOME and your previous stash_home are the same. If that is good then your upgrade/migration should be fine. Also, it does really matter if the DB is named stash or bitbucket. Its the information inside that is important.
The users are located in the DB. So if the DB is the same then the users are the same.
I suspect the reason you could not contact JIRA is that you move from one server to the other. This means your AppLink from JIRA to BITBUCKET is referring to the old server URL.
So you will have to log in as a local user correct the Applink.
You should be able to follow this KB if needed to create a new local admin user
But before we get to that just make sure you create an admin user before the migration as a fail safe.
I hope this helps. Let me know if you have any questions
~Lonnie
Hi Lonnie,
Thanks for the reply. BITBUCKET_HOME was only a problem when running Bitbucket using the start-bitbucket.bat script as it seems to set environment variables in the batch files called by the parent script (our Bitbucket home dir is outside of the Bitbucket installation directory).
I think the creation of a local user within the DB itself will sort my problem. Will have a look at the table, thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi again,
Sorry for the delayed reply - priorities elsewhere!
I am using a slightly earlier KB as the schema in my live DB doesn't reflect some of the Bitbucket changes, this is the one I have - https://confluence.atlassian.com/stashkb/restore-stash-s-administrator-user-435553181.html
Interestingly I only seem to have one column in my stash_user table? 'name' and 'slug' don't exist, I have an 'id' column and nothing else so I think I am missing a part of the user creation process. I am going to crack on and follow what I can in the kb (it's only a restored copy of the live DB) and see where I can get but I didn't know if you had a take on the missing columns?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Sam, If you know a user id for the admin user: You can follow:
https://confluence.atlassian.com/bitbucketserver/lockout-recovery-process-776640158.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Looks like you don't even need an existing user!
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.