Initial commit
This commit is contained in:
commit
3a0d6186c9
6 changed files with 358 additions and 0 deletions
59
README.md
Normal file
59
README.md
Normal file
|
@ -0,0 +1,59 @@
|
|||
# GitHub to Forgejo Migration Script
|
||||
|
||||
This repository contains a Python script to migrate repositories from **GitHub** to **Forgejo**.
|
||||
It supports private and public repositories owned by the authenticated GitHub user.
|
||||
|
||||
## Setup
|
||||
|
||||
1. Clone this repository:
|
||||
|
||||
```bash
|
||||
git clone git@your-forgejo-instance:username/github-to-forgejo.git
|
||||
cd github-to-forgejo
|
||||
```
|
||||
|
||||
2. Install dependencies with Pipenv:
|
||||
|
||||
```bash
|
||||
pipenv install
|
||||
```
|
||||
|
||||
## Authentication
|
||||
|
||||
You need to create **personal access tokens** for both GitHub and Forgejo.
|
||||
|
||||
### GitHub Token
|
||||
|
||||
1. Go to [GitHub Personal Access Tokens](https://github.com/settings/tokens).
|
||||
2. Create a new **classic** token with the following scopes:
|
||||
- `repo` (required for private repos)
|
||||
- `read:project` (if you want project boards)
|
||||
- `read:org` (optional, if repos are in orgs)
|
||||
- `read:discussion` (optional, usually not needed)
|
||||
3. Copy the generated token.
|
||||
|
||||
### Forgejo Token
|
||||
|
||||
1. Log into your Forgejo instance.
|
||||
2. Go to **Settings → Applications → Manage Access Tokens**.
|
||||
3. Create a token with these scopes:
|
||||
- `repository (read/write)`
|
||||
- `issue (read/write)`
|
||||
- `misc (read/write)`
|
||||
- `user (read/write)`
|
||||
4. Copy the generated token.
|
||||
|
||||
### .env file
|
||||
|
||||
The settings are stored in the .env file. Copy the env-example file and call
|
||||
it .env
|
||||
|
||||
Put in both tokens and fill in the rest accordingly like usernames and URLs.
|
||||
|
||||
## Usage
|
||||
|
||||
Run the script to migrate repositories:
|
||||
|
||||
```bash
|
||||
pipenv run python migrate_github_to_forgejo.py
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue