-1

I want to duplicate/copy multiple s3 objects into the same bucket (source = destination)

The manifest only expects 3 fields (bucket, key, optional version) and without versioning enabled, the objects just get overwritten

Using the java v2 SDK to create the job.

Copying 1 object at a time would work, but even for <500 objects it does take time

Beig
  • 403
  • 1
  • 4
  • 19
  • I might be missing something but: You might edit to post your code (with tokens removed) and a sample input. If you're copying `bucket/foo/folder` to itself why would you expect it to not overwrite itself? Are you expecting it to copy '`file1` to `file1 (1)` or something? – Dave S Aug 30 '23 at 20:49
  • either providing a targetKey or let s3 generate a new key would work as I see it, i can only copy the objects to a different bucket, but not duplicating them in the same bucket – Beig Aug 30 '23 at 20:57
  • I'm still missing something. I don't see how `bucket/folder/file1.txt` can point to two different objects "without versioning enabled" ? That doesn't work with URLs or filesystems. Please edit your question to explain in more detail. – Dave S Aug 30 '23 at 22:24
  • what dont you understand under "duplication"? i want to duplicate an object, obviously it needs a unique key/name – Beig Aug 30 '23 at 22:58
  • So you want to copy `bucket1/folder1/*` to `/bucket1/dupfolders/folder1/` ? CLI `cp` supports folder-to-folder copies but the answers I see don't show a way to use wildcards in the SDKs. See for example - https://stackoverflow.com/questions/51709543/how-to-copy-whole-s3-folders-using-php-aws-sdk – Dave S Aug 30 '23 at 23:03

0 Answers0