Transfer ownership of workspace
Asked by Julien B:

Hello,

Our Bitbucket Workspace was created by a non-personnal account (a shared account called A).

We've added users as "administrators" of this workspace, but when I want to delete the non-personnal account A, it tells me that it will delete all repositories within the workspace.

It seems that the non-personnal account is some kind of "owner" of the workspace, which isn't explicit anywhere on this interface (the account even seems to have additional user rights for example to add apps to the workspace).

How can we transfer the ownership of the workspace?

Thanks  
Julien


Answers:
author: Leah Rivkin
body: Hi Julien,  
Here's some background on Workspaces in Bitbucket:  
Prior to the release of Workspaces earlier this year Bitbucket had two account types: Personal and Team. Personal accounts are linked directly to the user and Team accounts are separate or shared. With Workspaces we wanted to consolidate on a single account type for several reasons:

* We wanted to provide more privacy for end users so that their username was not directly linked to repository paths. (You can change workspace id and username independently.)
* We wanted to move away from specific users owning content because we want to support teams and organizations better where users may come and go.
* We wanted a consistent experience across all workspaces regardless of the type.

For the sake of backward compatibility and as we deprecate some of our APIs we need to maintain the link between Workspaces that were formally Personal accounts with the user as we work to separate them completely. These workspaces ***cannot be unlinked*** from the user just yet and the user must be an admin on that workspace for now. Any user can be made an admin of these workspaces, but there is a tie between the account and the workspace that cannot be broken. If that account is deleted, the workspace and its repositories are deleted. We hope some day to add this functionality so users can create content and collaborate with their teammates seamlessly.  
Any newly workspace created ("**Create-\>Workspace**") or any workspace that was originally a Team account are not linked to specific users. Any user can be made an Admin of these workspaces and any user can leave these workspaces. If an admin's account is deleted, the content of that workspace will remain accessible to all other admins and members.  
For your account "A" did you create a new Workspace from the "+" (Plus) menu on the menu bar or did you sign up a new account in Bitbucket? This might be the source of the issue. Creating a new account in Bitbucket creates a new user account tied for that email.  
For legacy reasons, that user will have a new workspace tied to the user. Deleting that user will delete the workspace as well and vice-versa.  

If you'd like to transfer these repositories, you can take the following steps:

1. Create a new workspace from the "+" menu. This workspace will be the owner of all your repositories.
2. Make yourself an admin on workspace A (the shared account that currently "owns" these repositories).
3. Transfer your repositories from A to the new workspace.

Once this is done, you can delete shared account A if you'd like. The repositories will exist in your new workspace.  
Thanks!

comments: author: Tiago Protta Gigli
body: We, currently have about 490 repos, 175 users, 40 projects and 7 groups.

Migrating repos, all other stuff (users, groups - and its definitions, projects and variables) will not migrate and I will need to do it by hand?

Is that right? Just bc Atlassian can't transform a workspace from personal to shared one?

There is no other way?


author: Vikram Kuruba
body: We've a similar requirement where we want to move to a shared workspace, is it possible to move to a Team workspace instead of a personal one?


author: neurostream
body: When I started setting up the bitbucket.org **repos for my company for the first time** , it wasn't obvious that the username/WorkspaceID would be tied my own email/loginID during the first-time account creation workflow. I assumed that, worse case, there would be an easy "transfer workspace" option like there is for repos. At this time of my comment here, there **wasn't an option to transfer a workspace** like this.

I didn't realize I would be able to create additional WorkspaceIDs later after the initial bitbucket.org sign up workflow, and I was **worried I wouldn't later have a chance to reserve that URL** space for my company. If this was more obvious the first time I interacted with bitbucket.org, I would have created a more "personal" WorkspaceID for own my scratch space - and then immediately added another WorkspaceID for the company after my first login. So, I created the WorkspaceID under **my individual human company email address** they gave me - which also didn't feel right.

To retain the same URL space, reserving that **for my company to "own"** so the company doesn't have to keep my email account open **after I've moved on to another job** , **I "transferred" the Workspace/URL like this**:

1. log in and create a **new Workspace** with a new **temporary name;**
2. create all the **same Project names** under the new Workspace;
3. **transfer all repos** from the original Workspace to the new Workspace with the temporary name. ( this would be disruptive to any build systems/git clients during this transfer process - it took me a couple minutes per repo, there's a **confirmation email** for each )
4. change my own Bitbucket.org account name space to free up \["myOrgName"\] for my company. I had to change this in 3 places in my bitbucket.org web session:
   1. **change my username** (<https://bitbucket.org/account/settings/username/change/> )
      1. afterwards, I had to update the username@bitbucket.org-part of my local machine repos ( in the git cli, see **git config --list \| grep remote.origin.url** and **git remote set-url origin** newusername@bitbucket.org/... ). my other existing users were using their own bitbucket.org usernames already, so this was just my own locally cloned repo config that needed updating )

   2. **change my Workspace Name**
   3. **change my WorkspaceID**
5. change the **temporary Workspace name to \["myOrgName"\]** ( the name I too-hastily reserved for myself when signing up the first time ). I took the risk that someone on the Internet could snipe that name during this time, so I completed this step as quickly as possible ( less than a minute ) after step 4.
6. **add other owners ( email address )** in your company as owners/admins of that newly created workspace

Not sure if this is the best/supported way - but **the key thing I missed** when reading other comments was the emphasis on changing my bitbucket.org username as well as the workspaceID if they were also the same - which, in my case, they were.

comments: author: skillo-alexandru-bujdei
body: Thank you for this.  
It helped me a lot today.


author: Tiago Protta Gigli
body: There is no tool to do this easily?


author: Mark C
body: Hi All,  

There's a knowledge-based article that explains [different ways to change Bitbucket Cloud shared workspace ownership](https://confluence.atlassian.com/bbkb/different-ways-to-change-bitbucket-cloud-shared-workspace-ownership-1299910103.html).  

For the feature/tool to use for transferring workspace ownership, there's an existing feature request for it that can be located through this link. - <https://jira.atlassian.com/browse/BCLOUD-22898>  

You can upvote and watch it for now so that you'll be notified of any updates from our team when the feature becomes available on Bitbucket Cloud.  
Please do note that we don't have an exact ETA for the feature request as all new features will be implemented according to [our policy here](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html).  

Regards,  
Mark C


Tags: bitbucket-cloud

cloud