feat(cli): data migration script — MinIO to filesystem #130
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Write a Go CLI command (
silo migrate-storage) to migrate all files from MinIO to the local filesystem backend, with checksum verification and database updates.Context
After the filesystem backend (#127) and metadata columns (#128) are in place, existing deployments need a way to move their files from MinIO to the filesystem. The migration must be:
storage_backendcolumn in DB so the application knows where each file livesData to migrate
Two categories of stored objects:
Revision files — tracked in
revisionstableitems/{partNumber}/rev{N}.FCStdfile_key,file_version,file_checksum,file_sizefile_storage_backend(from #128)Item file attachments — tracked in
item_filestableitems/{itemID}/files/{uuid}/{filename}object_key,sizestorage_backend(from #128)Thumbnails — tracked in
items.thumbnail_keyandrevisions.thumbnail_keyitems/{itemID}/thumbnail.png,thumbnails/{partNumber}/rev{N}.pngMinIO bucket
Bucket name:
silo-files(configured instorage.bucketor env var, default fromconfig.example.yaml).Requirements
CLI entry point
Add a
migrate-storagesubcommand to thesilodbinary (or a separatesilo-migratebinary):Algorithm
Flags
--dry-run: List files that would be migrated without actually migrating--batch-size: Number of files to process before committing DB updates (default 100)--workers: Number of concurrent download/upload workers (default 4)Error handling
storage_backendis already'filesystem'Files to create/modify
cmd/silod/migrate.go(orcmd/silo-migrate/main.go) — CLI entry pointinternal/storage/for both MinIO and filesystemFileStoreimplementationsinternal/db/for database accessinternal/config/for configurationTesting
Acceptance criteria
'filesystem'backend--dry-runmode worksPriority
P1
Depends on
Part of
Storage Migration: MinIO → PostgreSQL + Filesystem