Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lionyxml/migrate-github-to-codeberg

Effortlessly migrate GitHub repositories to Codeberg! Seamlessly transfer project. Powered by Bash, curl, and jq.
https://github.com/lionyxml/migrate-github-to-codeberg

Last synced: about 1 month ago
JSON representation

Effortlessly migrate GitHub repositories to Codeberg! Seamlessly transfer project. Powered by Bash, curl, and jq.

Awesome Lists containing this project

README

        

#+TITLE: GitHub to Codeberg Migration Script
#+AUTHOR: Rahul Martim Juliato
#+EMAIL: [email protected]
#+OPTIONS: toc:nil

* Overview

This script automates the migration of GitHub repositories to
Codeberg. It allows you to seamlessly transfer your projects from
GitHub to Codeberg while preserving their metadata, such as
descriptions and access permissions.

* Features

- Migrate all or selected repositories from GitHub to Codeberg.
- Customizable prefix for repository descriptions.
- Supports pagination for fetching large numbers of repositories.
- Error handling for repository migration failures.

* Limitations

Due to the complex nature of both Github and Codeberg apis, it was a
design choice for this script to omit several features like:
- distinction between forks and original repositories
- wiki
- pull requests
- avatars for projects

...and so on. Please modify this script to your own needs.

* Usage

** Configure User Settings
- Open the script file (~migrate_repositories.sh~) in a text editor.
- Update the user configuration section with your GitHub and
Codeberg credentials.
- Optionally, define the repositories you want to migrate by adding
their names to the ~REPOSITORIES~ array.

** Install Dependencies
- Ensure that ~curl~ and ~jq~ are installed on your system.
- On Debian/Ubuntu: ~sudo apt install curl jq~
- On macOS with Homebrew: ~brew install curl jq~

** Run the Script
- Execute the script by running ~./migrate_repositories.sh~ in your terminal.
- Follow the on-screen instructions to proceed with the migration.
- Press ENTER to start the migration process.

** Monitor Progress
- The script will display information about the migration progress,
including successful migrations and any errors encountered.

** Review Results
- Once the migration is complete, review the results to ensure all
desired repositories have been migrated successfully.

* Requirements

- Bash shell
- curl
- jq (JSON processor)

* Screenshots (in text mode)

#+BEGIN_SRC txt
----------------------------------------------
Welcome to Github to Codeberg Migration Script
----------------------------------------------

User on Github : LionyxML
User on Codeberg : LionyxML
Using description prefix: [MIRROR]
Migrating repo : aa
Migrating repo : dotfiles
Migrating repo : flycheck
Migrating repo : my_emacs_config

If you wish to change this, abort and change this script.

Press ENTER to continue, C-c to abort.

>>> Working...
>>> Migrating: aa... Error! Already exists on Codeberg.
>>> Migrating: flycheck... Success!
>>> Migration complete!
#+END_SRC

#+BEGIN_SRC txt
----------------------------------------------
Welcome to Github to Codeberg Migration Script
----------------------------------------------

User on Github : LionyxML
User on Codeberg : LionyxML
Using description prefix: [MIRROR]
Migrating repo : all

If you wish to change this, abort and change this script.

Press ENTER to continue, C-c to abort.

>>> Working...
>>> Migrating: 100_computer_science_concepts... Error! Already exists on Codeberg.
>>> Migrating: 10_design_patterns... Error! Already exists on Codeberg.
>>> Migrating: aa... Error! Already exists on Codeberg.

#+END_SRC