Is there any way to recover my old repository?
Asked by harrys muahammed:

I cant see my repository which is having the code that is being in use by some live servers while re-deployement. I was unaware of the notifications and I have not used my bitbucket account for quite awhile. I have read <https://community.atlassian.com/t5/Bitbucket-questions/Old-bitbucket-repository-disappears/qaq-p/1982754>  
and <https://community.atlassian.com/t5/Bitbucket-questions/My-repositories-disappeared-after-inactivity/qaq-p/1070943>.

sorry for raising this query again after around 5 years., Is there any way to recover my old repository <https://bitbucket.org/workspace-id>


Answers:
author: Theodora Boudale
body: Hi [@harrys muahammed](/t5/user/viewprofilepage/user-id/5515025) and welcome to the community!

The account of the workspace you linked in your post is associated with a different email address (different than the email address of your community account). If that is also your account, you will need to log in with its primary email address in order to access the workspace and its repos.

If the repository you are looking for is a Mercurial repo, these have been deleted from our platform and recovery is not possible. In case it was a public Mercurial repo, all the public repos were archived by Software Heritage:

* <https://bitbucket-archive.softwareheritage.org/>

If you are looking for a Git repository, we do not delete Git repositories due to inactivity so the repo should still be there. You will just need to access the account by logging in with its email address.

++In case you don't remember the email address:++

If you remember the username of that account, and if you have an app password for this account that has at least **Account: Read** permissions, you can use the following API endpoint to get email addresses associated with this user:

* <https://developer.atlassian.com/cloud/bitbucket/rest/api-group-users/#api-user-emails-get>

Example:

```
curl -u Bitbucket_Username:App_Password -X GET -H "Content-Type: application/json" https://api.bitbucket.org/2.0/user/emails
```

If the account has email aliases, those will be returned as well, but the field**is_primary** will indicate the primary email of the account that you need to log in with. Please note that the API call requires an app password for authentication and not the account's password, as we have deprecated the use of account passwords for API.

If you don't remember the username or if you don't have an app password for that account, then I would suggest trying to log in to <https://bitbucket.org/> from browser with any of the email addresses you own, and see if any of them logs you into the correct account. In case you use GMail, please keep in mind that myemail@gmail.com and my.email@gmail.com share the same inbox in GMail, but for Bitbucket they are considered separate email addresses.

Please note that if you get asked to give a username and create a new account after logging in with a certain email, this means that there is no Bitbucket Cloud account with that email as primary, so you can skip that email from the process.

Just a heads up, I removed the workspace URL from your post for privacy reasons.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud