From 08a8d559f9a8e41680c05d1e12e3f500fc8517c5 Mon Sep 17 00:00:00 2001 From: ton Date: Fri, 26 Sep 2025 08:43:02 +0000 Subject: [PATCH] Add GiteaMigrate.sh --- GiteaMigrate.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 GiteaMigrate.sh diff --git a/GiteaMigrate.sh b/GiteaMigrate.sh new file mode 100644 index 0000000..30baaf1 --- /dev/null +++ b/GiteaMigrate.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# *** manually CREATE EVERY empty repos in a new Git server before using this script to migrate + +# Old and new Gitea URLs +OLD_GITEA_URL="http://192.168.1.100:3000" +NEW_GITEA_URL="https://git.yiem.cc" +USERNAME="ton" + +# Manually list the repo names (no token, so we can't fetch them via API) +REPOS=("GeneralUtils" "YiemAgent" "SQLLLM" "tonBookmarks" "LLMMCTS" "ImageUtils" "FormatCorrector" "ChatAgent_v2" "ChatAgent" "GeneralUtilsGPU" "Mosquitto" "CommUtils" "IronpenGPU" "Ironpen" "SNNUtils" "ANNUtils") # Add your repo names here + +mkdir -p gitea-migration && cd gitea-migration + +for REPO in "${REPOS[@]}"; do + echo "🔗 Cloning $REPO from old Gitea..." + git clone --mirror "$OLD_GITEA_URL/$USERNAME/$REPO.git" + + cd "$REPO.git" || { echo "❌ Failed to enter $REPO.git"; exit 1; } + + echo "📦 Pushing $REPO to new Gitea (will prompt for password)..." + git remote set-url origin "$NEW_GITEA_URL/$USERNAME/$REPO.git" + git push --mirror + + cd .. + echo "✅ $REPO migrated!" +done