I want to copy a folder (size 150MB - 200MB) of one S3 bucket to another S3 bucket of the different region using PHP or in S3 term "duplicate all objects with the prefix of an S3 bucket into objects with a different prefix to another S3 bucket"
I have tried below code but it's not workings
$s3 = new S3Client(['credentials' => $credentials, 'version' => 'latest','region' => $region,'debug' => false ]);
$s3->registerStreamWrapper();
$result = $s3->uploadDirectory("s3://{$source_bucket}/{$key}",$target_bucket);
and I have also tried to list out all objects (using listObject function) from source bucket then copy it (Using copyObject function ) into destination bucket. But this process is consuming too much time.
Any suggestion