Move all item files from one storage to another - #515
Merged
Merged
Conversation
Add a MoveStorageFiles workflow and a "Move Whole Storage" form on the trigger UI's /move-files page. It lists the source storage (optionally a folder of it) page by page and moves every item file, any shape, to the destination storage one at a time, keeping the relative path. A dry run only counts files and bytes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a way to pick a source storage and move every Mediabanken item file on it to another storage. Until now,
/move-filesonly moved theoriginalshape of VX IDs pasted in by hand./move-fileswith:MoveStorageFilesworkflow: lists the source storage 500 files at a time and moves every file that belongs to an item (all shapes) using the existingCantemo.MoveFileWait, one file at a time.YYYY/MMof the item's Cantemo creation date (system_metadata.created, newCantemo.GetItemCreatedactivity). A shallow file whose item has no creation date isn't moved and is counted as failed.source -> destinationpaths and counts how many files get a date folder (Redated).ListItemFilesOnStorageactivity: wrapsvsapi.ListFilesForStorage, which nothing called before. That method is now on thevidispine.Clientinterface, and the mock is regenerated.Things to know
MoveFileWaitcan report success without the file having moved. A file still on the source after its move is counted as failed and not tried again, so the workflow can't loop on it.includeItem=true→item[].shape[].id) against production. The first dry run on a small folder will confirm it: a count of 0 for a folder that has assets means it's wrong.Test plan
go build ./...andgo vet ./...MoveStorageFilesworkflow tests: dry run, full move, a failed move is skipped, a file still on the source isn't retried, and invalid or identical storages are rejected, shallow files go under the creation month, a shallow file with no creation date isn't moved🤖 Generated with Claude Code