Bitbucket
Configuration settings for backing up repositories from Bitbucket.
Warning
Known limitations:
Issues are not backed up
- SCM Backup supports Bitbucket Cloud (see Hosting Options) only, the self-hosted options are not supported!
⇒ see Why doesn’t SCM Backup support backing up local installations of [hoster X]?
Sources
For the basics, please read the Sources section first.
For Bitbucket, the hoster entry in the config file needs to look like this:
hoster: bitbucket
SCM Backup will always backup a Bitbucket Workspace.
https://bitbucket.org/WORKSPACEID/REPO/…so the URL part directly behind https://bitbucket.org is the workspace ID.To backup the repos of any workspace, the
nameentry in the config needs to be set to the workspace IDIf the workspace is the user’s “personal” workspace (workspace name is equal to username), set the
typein the config touser. For any other workspace, set thetypetoorg. [1]
Authentication
Without authentication, SCM Backup can only backup your public repositories.
In this case, it shows a warning:
To backup your private repositories as well, you need to authenticate with a user who has sufficient permissions to the workspace’s repositories.
Warning
In the past, Bitbucket used app passwords for this. App passwords are now replaced by API tokens and all existing app passwords will be disabled June 9, 2026 (source: 1, 2).
If you’re currently using app passwords to authenticate SCM Backup, you must replace them by API tokens before June 9, 2026.
Create an API token for SCM Backup for that user:
Login with your Atlassian ID, go to the API tokens page and follow these steps to create a new API token with scopes.
(important: there are two options to create a token either with or without scopes, and you need one with scopes!)
Select Bitbucket as the app, and give the token at least the following permissions:
read:repository:bitbucketread:wiki:bitbucket
Put your Bitbucket username, email address, and the API token into the
authName,apiAuthNameandpasswordproperties of the source in the config file.Note
By default, a user’s workspace ID is equal to the user name, but it’s possible to change the workspace ID, so workspace ID and user name don’t match anymore.
In this case, you need to set
nameto the workspace ID andauthNameto the user name.Example:
sources: - title: some_title hoster: bitbucket type: org name: your_workspace authName: your_user_name apiAuthName: your_bitbucket_email@example.com password: your_api_token
This will backup the repositories of the workspace
your_workspace, but authenticate with:the email address
your_bitbucket_email@example.comand the API token (for calling the Bitbucket API)the user
your_user_nameand the API token (for Git commands)
Footnotes