A user has recently deleted a repository by mistake, however it is still needed by other members of the team. There are no single backups of this repository and no developers have a local clone of this repository. Even if there were a local clone, the metadata associated with the repository (configuration, pull requests, etc.) are not available to be restored.
Mark a repository as deleted and keep all metadata and the repository on disk intact but inaccessible.
- A server or system administrator could then go ahead and permanently delete any such repositories; or
- A scheduled cleanup could be performed on a configurable timeout (e.g. automatically clean up repositories that are marked as deleted after 60 days)
Prior to the actual deletion of a repository, automatically create a backup of the current state of the repository and make this accessible to download to administrators.
- A server or system administrator could then permanently delete this backup once they have a local copy or it is no longer needed.
- A scheduled cleanup could be performed on a configurable timeout to delete old backup files.
If you'd like more information about restoring an accidentally deleted repository, please read our knowledge base article about this, however note that it requires a backup of some sort to be available, either in the form of a proper backup or a local clone of the repository.
Note that there is a very similar feature request open for restoring a repository and all its details from a backup. This issue is specifically about Bitbucket Server preserving the data and state of a repository in some way upon deletion so that it can be seamlessly restored without the use of an external backup.
There are several recommended and supported backup strategies, please be sure to use the right backup strategy for your individual needs.