How to list Projects and Repositories that have been renamed or moved and their aliases in Bitbucket Data Center

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

This knowledge-base article provides queries for listing projects and repositories that have aliases.

Bitbucket 5.0 added the feature for historical aliasing of projects and repositories:

BSERV-3751 - Allow historical aliasing of projects and repositories

With this feature, projects and repositories that have been renamed or moved can still be accessed using their original identifiers (project keys for projects and repository slugs/names for repositories).

The original identifiers are referred to as "aliases".

Solution

Tables

Aliases are stored in the following database tables:

Table

Description

bb_repository_alias

A row is added to this table when a repository is renamed or moved between projects

bb_project_alias

A row is added to this table when a project key is changed

Sample queries

Repositories that have been renamed or moved

1 2 3 4 select r.id as repo_id, p.project_key, r.slug as repo_slug, bra.project_key as alias_project_key, bra.slug as alias_repo_slug from repository r inner join project p on p.id=r.project_id inner join bb_repository_alias bra on bra.repository_id=r.id;

Projects whose keys have been changed

1 2 3 select p.id as project_id, p.project_key, bpa.project_key as alias_project_key from project p inner join bb_project_alias bpa on bpa.project_id=p.id;

Updated on April 2, 2025

Still need help?

The Atlassian Community is here for you.