This is based on offically cli tool built-in subcommand calls migrate-storage.
Last active
August 29, 2024 11:33
-
-
Save icyleaf/e2d3a0698da853b026801fd92c655920 to your computer and use it in GitHub Desktop.
Gitea migrate storage from local to minio auto script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
MINIO_ENDPOINT=localhost:8080 | |
MINIO_USE_SSL=false | |
MINIO_SSL_INSECURE_VERIFY=false | |
MINIO_ACCESS_KEY=123 | |
MINIO_SECRET_KEY=456 | |
MINIO_BUCKET=gitea | |
GITEA_MIGRATE_TYPES=(attachments lfs avatars repo-avatars repo-archivers packages actions-log) | |
for type in "${GITEA_MIGRATE_TYPES[@]}"; do | |
minio_base_path=${type//-/_} | |
echo "Migrating ${type} ..." | |
gitea migrate-storage --type=${type} \ | |
--storage=minio \ | |
--minio-endpoint=${MINIO_ENDPOINT} \ | |
--minio-access-key-id=${MINIO_ACCESS_KEY} \ | |
--minio-secret-access-key=${MINIO_SECRET_KEY} \ | |
--minio-bucket=${MINIO_BUCKET} \ | |
--minio-base-path=${minio_base_path}/ \ | |
--minio-use-ssl=${MINIO_USE_SSL} \ | |
--minio-insecure-skip-verify=${MINIO_SSL_INSECURE_VERIFY} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here some updates,
Need to run with git user
sudo -u git gitea --config=/etc/gitea/app.ini migrate-storage
and put the config path.And more types to migrate
GITEA_MIGRATE_TYPES=(attachments lfs avatars repo-avatars repo-archivers packages actions-log actions-artifacts)
However I got :
Command error: permission denied
. Any help @icyleaf ?Here complete logs