Skip to content

fix(scripts): use rclone instead of MinIO mc in storage migration script - #810

Merged
pikann merged 2 commits into
masterfrom
feature/add-migration-script-for-switching-storage
Nov 21, 2026
Merged

pikann merged 2 commits into
masterfrom
feature/add-migration-script-for-switching-storage

Conversation

@pikann

@pikann pikann commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #809. scripts/migrate-storage.sh copied objects with MinIO's mc client from quay.io/minio/mc. MinIO is deprecated, and the pull fails on some hosts (401 UNAUTHORIZED from quay.io), which the script then misreported as "Cannot read source bucket". This switches the copy to rclone (rclone/rclone from Docker Hub), so no MinIO software or image is involved.

Changes

  • Copy, size and verify steps now use rclone. Both remotes are defined via RCLONE_CONFIG_* env vars passed to Docker by name, so secrets never appear in the docker run argv.
  • Verification now checks that every source object exists in the destination with the same size (rclone check --one-way --size-only), in addition to the object-count/size totals. Hashes are not compared because ETags legitimately differ between stores.
  • The rclone image is pulled up front, so a registry problem is reported as one instead of as a storage-credential error.
  • --to s3 no longer creates the bucket: it must already exist, so the key needs no s3:CreateBucket. --to rustfs still creates its bucket.
  • PACA_MC_IMAGE is replaced by PACA_RCLONE_IMAGE (default rclone/rclone).
  • Docs note the rclone image and the pre-existing-bucket requirement.

Testing

Both directions run end to end against throwaway containers (a second RustFS container standing in for S3), including an object key with spaces, verification, the .env rewrite and the api restart. shellcheck passes. Not yet tried against real AWS S3.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one documentation follow-up inline.

Approach: sound — defining both remotes through RCLONE_CONFIG_* env vars removes MinIO from the copy path, keeps credentials out of the docker run argv, and the added rclone check --one-way --size-only covers the per-object gap the old count/size heuristic left open.

Reviewed changes — both files in the PR. The load-bearing mechanics check out against the rclone, Docker and AWS docs: env-defined remotes (unset vars are simply not passed into the container), the AWS-vs-Other provider split, --to s3 relying on no_check_bucket so no bucket is created or probed, size --json parsing, and check --one-way --size-only exiting non-zero on missing or size-mismatched objects.

  • scripts/migrate-storage.sh — copy, stats, and verification now run through rclone/rclone; --to rustfs still creates its bucket with rclone mkdir, --to s3 requires a pre-existing bucket, the image is pulled up front so a registry failure reports as one, and PACA_MC_IMAGE is replaced by PACA_RCLONE_IMAGE.
  • docs/deployment/README.md — documents the rclone image and the pre-created-bucket requirement for --to s3.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

Comment thread docs/deployment/README.md Resolved

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — the delta since the prior pullfrog review is documentation only (docs/deployment/README.md, +23 lines); the script is unchanged.

  • docs/deployment/README.md — adds a "Can't pull quay.io/minio/mc?" fallback that runs the manual backup and restore steps with rclone/rclone, defining both remotes through RCLONE_CONFIG_* env vars passed to Docker by name. This resolves the previous review's follow-up about hosts that 401 against quay.io; rclone mkdir is idempotent, so the restore works whether or not the API already created the RustFS bucket, and upgrade.sh leaves the storage credentials untouched so the step-4 restore still authenticates.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

@pikann
pikann merged commit 945b1cb into master Nov 21, 2026
6 checks passed
@pikann
pikann deleted the feature/add-migration-script-for-switching-storage branch November 21, 2026 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant