This is based on offically cli tool built-in subcommand calls migrate-storage.
Last active
November 7, 2025 18:40
-
-
Save icyleaf/e2d3a0698da853b026801fd92c655920 to your computer and use it in GitHub Desktop.
Gitea migrate storage from local to minio auto script
This file contains hidden or 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
@GhaziTriki I was able to use my
giteauser to perform this migration with your suggested changes. I did not encounter any issues with my migration.One thing worth noting, be careful not to put
http://in front of theMINIO_ENDPOINTotherwise you will get:an error stating:
Endpoint url cannot have fully qualified paths.