Skip to content

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

License

Notifications You must be signed in to change notification settings

LionyxML/migrate-github-to-codeberg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

GitHub to Codeberg Migration Script

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)

    ----------------------------------------------
    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!
    ----------------------------------------------
    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.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages