Documentation

FileMigrata help

Migrate Amazon S3 to Cloudflare R2 (stop paying egress twice)

This article explains how to copy an Amazon S3 bucket to Cloudflare R2 with FileMigrata. Teams usually move to R2 to stop paying AWS egress on every download.


Limitations

  • FileMigrata reads S3 once during the migration. AWS charges egress for that read. R2's zero egress applies only after cutover.
  • R2 cannot list older object versions through the S3 API. Only current objects are copied. See R2, Azure Blob, and ETag traps.
  • Objects under an S3 object-lock legal hold that blocks GET are not copied.
  • Glacier objects that have not been restored are not copied.
  • An R2 custom domain is not the S3 API endpoint. FileMigrata uses the account hostname.
  • AWS multipart ETags are not MD5 hashes. FileMigrata hashes each file independently.
  • FileMigrata copies by default and does not delete the source.

What is migrated

  • Current objects and prefixes
  • Content-Type, stored by R2 on each object

Prerequisites

  • An IAM user with list and get permission on the S3 bucket. See Connect Amazon S3.
  • An R2 API token that can list buckets, and the account hostname https://<accountid>.r2.cloudflarestorage.com. See Connect R2.
  • Application configuration you can change to point at R2.

Mapping

  • Map one S3 bucket or prefix to one R2 bucket.
  • Keep object keys unchanged unless you have a reason to rewrite them. Changed keys require every client path to change.

Steps

  1. Connect Amazon S3.
  2. Connect R2 with the account hostname from the Cloudflare dashboard.
  3. Start with one mapping. For an estate-wide cutover, contact sales.
  4. Copy the current objects.
  5. Run the job again to copy changes made since the first run.
  6. Point the application at R2.
  7. Optionally, empty the S3 bucket yourself.

Troubleshooting

  • AccessDenied on ListBucket: The IAM policy is missing the bucket resource. Fix the policy and resume the job.
  • Unauthorized from R2: The token cannot list buckets. Use an Admin Read token, or type the bucket name manually.
  • Network dropped: Resume the same job.

Alternatives: rclone on an EC2 instance with a VPC endpoint avoids AWS egress on the read. FileMigrata is better suited when the other side is a drive or you want a resume interface. For Wasabi, see S3 to Wasabi.


Related articles