Batch creating 1000's of publishedfiles

We are starting a new project and I need to recreate all the published files with updated file paths in the new project and share the thumbnails across.

Is there a faster way then using sgtk.util.register_publish?
As far as I know I can’t do this with a batch command. Since doesn’t it create a bunch of special events to go along with it?

1 Like

Your sentiment sounds right. You would have to “deconstruct” register_publish into operations that can be batched.

Batch creating the PublishedFile entities is clear.

You have to consider how to handle attachments. The simplest solution is to just point to the same attachment from the new entity. This would save on space and execution time. Copying the attachments will be quite a bit more work. Depends on your use case.
Thumbnails also present the same issue.

The hooks should probably be fired once for the entire batch.

It would be cool to have register_publish_batch in core.