Skip to content

Latest commit

 

History

History
75 lines (60 loc) · 2.15 KB

README.md

File metadata and controls

75 lines (60 loc) · 2.15 KB

Logo

Repository Migrator

Migrates repositories between BitBucket, GitHub, and local storage.

This tool works in both directions, so you can move your GitHub repositories to BitBucket and vice versa.

You can also back up your repositories locally.

Requirements

  • Python3.

Installation

  1. (If you plan to use BitBucket) Create BitBucket app password with the Repositories: Read, Repositories: Write and Repositories: Admin permissions:

    https://bitbucket.org/account/settings/app-passwords/new.

  2. (If you plan to use GitHub) Create GitHub personal access token with the repo scopes:

    https://github.com/settings/tokens/new.

  3. Clone the tool repo:

$ git clone [email protected]:torunar/repository-migrator.git
  1. Install dependencies:
$ cd repository-migrator
$ pip3 install -r requirements.txt

Usage

Migrate from BitBucket to GitHub

$ python3 repository-migrator \
    --input=bitbucket \
    --output=github \
    --bitbucket-login='Your BitBucket username' \ 
    --bitbucket-password='App password from Installation step 1' \
    --github-login='Your GitHub login' \
    --github-password='Personal access token from Installation step 2' 

Migrate from GitHub to BitBucket

$ python3 repository-migrator \
    --input=github \
    --output=bitbucket \
    --bitbucket-login='Your BitBucket username' \ 
    --bitbucket-password='App password from Installation step 1' \
    --github-login='Your GitHub login' \
    --github-password='Personal access token from Installation step 2' 

Back up repositories from GitHub

$ python3 repository-migrator \
    --input=github \
    --output=local \
    --github-login='Your GitHub login' \
    --github-password='Personal access token from Installation step 2' 

Back up repositories from BitBucket

$ python3 repository-migrator \
    --input=bitbucket \
    --output=local \
    --bitbucket-login='Your BitBucket username' \ 
    --bitbucket-password='App password from Installation step 1'