Skip to main content

CLI tool for migrating Bitbucket repositories to GitHub Enterprise

Project description

bb2gh

Documentation License: BSL-1.1 Python 3.11+

Bitbucket to GitHub migration tool. Migrate repositories with full metadata preservation, including Pull Requests, comments, user attribution, and secrets.

Features

  • Terraform-inspired workflow: discover -> plan -> migrate -> validate
  • Full metadata preservation: Git history, branches, tags, PRs, comments, user attribution
  • LFS support: Automatic detection and migration of LFS objects
  • Secrets migration: Assisted secrets migration via Infisical integration
  • Enterprise ready: Supports GitHub Enterprise Cloud, Data Residency, and Enterprise Server
  • Resilient: Checkpoint and resume capability, plus rollback options

Requirements

  • Python 3.11 or newer
  • git and git-lfs available in PATH

Installation

# Using pipx (recommended for CLI tools)
pipx install bb2gh

# Using pip
pip install bb2gh

PyPI and GitHub Releases are the supported public release channels.

The private repository builds the hardened bundle, and the public repository owns the visible GitHub Release and PyPI publication for that exact wheel.

If you need the exact published wheel, download it from GitHub Releases and verify it with the release checksums:

# Linux
sha256sum -c SHA256SUMS

# macOS
shasum -a 256 -c SHA256SUMS

On Windows PowerShell, use Get-FileHash for the downloaded wheel and compare it with the matching entry in SHA256SUMS.

Source-install from the public repository is unsupported in the hardened public release path. Homebrew is paused until a hardened formula exists.

Setup

Option 1: Interactive login

# Install with keyring support
pip install bb2gh[secure]

# Run interactive setup
bb2gh auth login

# Verify your setup
bb2gh auth status

Option 2: Environment variables

# Bitbucket
export BB_USERNAME=your-username
export BB_API_TOKEN=your-api-token

# GitHub
export GH_TOKEN=ghp_your-token

Required permissions

Bitbucket API token scopes: repository:read, pullrequest:read

GitHub PAT permissions: Contents (write), Pull requests (write), Administration (write), Metadata (read)

Quick Start

# 1. Discover your Bitbucket workspace
bb2gh discover --workspace my-company --output inventory.json

# 2. Generate a migration plan
bb2gh plan --inventory inventory.json --target-org my-gh-org --output plan.json

# 3. Execute the migration
bb2gh migrate --plan plan.json

# 4. Validate the migration
bb2gh validate --migration mig_xxx

Documentation

Full documentation is available at n8-group.gitbook.io/bb2gh.

Reporting Issues

License

Business Source License 1.1. See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bb2gh-0.14.2-py3-none-any.whl (376.0 kB view details)

Uploaded Python 3

File details

Details for the file bb2gh-0.14.2-py3-none-any.whl.

File metadata

  • Download URL: bb2gh-0.14.2-py3-none-any.whl
  • Upload date:
  • Size: 376.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for bb2gh-0.14.2-py3-none-any.whl
Algorithm Hash digest
SHA256 88e9a6f8e313adad39325e2904810b736bfff008bd150a6e4eababb43ecb6c8b
MD5 a475b71799cc4f734238477680d923ba
BLAKE2b-256 a59e16cd59ed91e3591998818f6410c508ebb4d1a67abaa565d7777508709653

See more details on using hashes here.

Provenance

The following attestation bundles were made for bb2gh-0.14.2-py3-none-any.whl:

Publisher: publish-bundle.yml on n8group-oss/bb2gh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page