How to move your data out of Cloudflare R2

A complete R2 exit covers bucket contents, object metadata, keys and edge access paths, and each needs its own export or rebuild step. This page sets out the documented export path with rclone over the S3 API, what does not travel with the data, and the order of work.

On this page

How to export data from Cloudflare R2 and what stays behind

If a renewal, a data residency rule or lock-in is pushing you to leave R2, the short answer is this: objects can be read out over R2's S3-compatible API with rclone, but bucket configuration, access keys, public domains and Workers code do not move with them. The data copy is the easy part. Plan the exit as four stages: inventory, copy, verify and rebuild. The inventory covers every bucket, its object count and size, any bucket lock rules, custom domains, lifecycle settings and each place an application reads from R2, including Workers bindings. Copying runs through the S3 API, and when you read over that API from your own environment, Cloudflare does not charge R2 egress fees on the export path. Confirm that against Cloudflare's current R2 pricing page before you budget, because the exact terms and any export limits are not covered by this page and must come from Cloudflare's own documentation.

Before you start the copy, confirm the API gaps that matter to you in Cloudflare's R2 documentation. Backup tools and retention rules often expect S3 versioning, Object Lock or bucket policies, and you need to know which of those R2 implements and which it does not. Those gaps affect the export only indirectly, but they decide what you must rebuild on the target. Run rclone with checksum or size verification on every bucket, and compare object counts and sizes against your inventory. Keep a record of each bucket's copy result, because that record becomes your evidence that the source data was complete when you cut over. Use a dedicated read-only R2 API token scoped to the buckets being exported, and revoke it when the export finishes.

Verification shows only that the bytes arrived. Rebuilding is where the exit usually stalls. Recreate access keys as identities on the new platform, switch application endpoints, and replace any public bucket domain or Workers binding with a reverse proxy or application-side reads against the new S3 endpoint. Rebuild retention intent, not just retention settings: an R2 bucket lock rule has no direct copy on the target, so decide how each protected dataset will be retained there. Keep the source buckets read-only until the new system has passed your checks, then delete them and confirm the deletion in writing. Ask your storage vendor or implementation partner to put each of these steps in a written scope with a named owner, so no bucket is left with a live dependency on Cloudflare.

Which R2 data you can export with rclone over the S3 API

This table maps each kind of R2 data to the rclone command that exports it, the output it produces and the limits you must confirm before starting. Read it as a checklist: verify every R2 limit and request cost against Cloudflare's current R2 documentation, then test each row on a small bucket before the full export.

Data typeExport methodOutput formatConfirm before export
Object bodiesrclone copy or sync using the S3 backend with the R2 endpointByte-identical files on the target store or local diskConfirm R2 request classes, read operation counts and any API rate limits
Object keys and prefixesrclone copy preserves key paths as directoriesDirectory tree mirroring key prefixes, with slashes in keys handled by rcloneTest keys with unusual characters, very long keys and empty folder markers
Metadata and content typesCopy with rclone's metadata option enabled for the S3 backendContent type and standard headers stored on the target objectCheck on a test bucket that R2 returns the headers you need to keep
Bucket listingsrclone lsjson or lsf to write a full inventory before copyingJSON or plain text inventory with sizes, modification times and pathsConfirm listing pagination behavior and the operation cost of a full listing
Custom metadataVerify with rclone lsjson and a head request on sample objectsKey-value pairs carried by the S3 metadata headers, if the copy preserves themConfirm which custom headers R2 stores and returns, and whether your target keeps them

What does not export with the objects and the workaround for each

Copying objects with rclone moves the data, but not the access model, bucket settings or edge behavior that surrounded it on Cloudflare. Each card below names one item that stays behind, the workaround on the target side, and the point where you should confirm behavior with Cloudflare or your new platform before cutover.

R2 API tokens and permissions

R2 access keys are created in the Cloudflare dashboard and scoped to buckets and actions, and they do not move with the objects. Recreate each application's access as a target-side user or key with the narrowest bucket and action scope it had on R2. On Ceph RGW that means RGW users with bucket policies, and on SeaweedFS it means re-creating S3 identities with per-bucket permissions. Inventory every token still in use, because a missed token fails silently until the application that holds it is cut over. Confirm the exact permission mapping with Cloudflare's token documentation and your target's access model.

Ceph S3 API docs

Bucket CORS and lifecycle rules

CORS and lifecycle configuration are bucket settings that rclone does not copy. Export both from R2 with the S3 API before you decontaminate the old bucket, then rewrite them for the target. Lifecycle rules on Garage are limited to aborting incomplete multipart uploads and expiration, so any transition or other rule needs a different mechanism. Check each rule's effect in a test bucket, since expiration on the target may behave differently from R2's implementation. Confirm supported rule types with the target's S3 compatibility reference.

Garage S3 compatibility

Public r2.dev and custom domains

Public buckets served through r2.dev addresses or custom domains attached to R2 are edge bindings, not objects. Users and embedded links that point to those hostnames break at cutover unless you move them. Put a reverse proxy you control in front of the target endpoint, terminate TLS on your domain, and map the same object paths to the same keys. Keep the old hostname answering for a period with redirects or proxying if clients cannot be updated at once. Confirm how Cloudflare handles hostname retirement and caching with its R2 public access documentation.

Workers code and bindings

Workers that read or write R2 use an in-platform binding, which has no S3 equivalent. Each Worker function that touches a bucket must be ported to call the target's S3 API with a signed client, or the logic must move to a service you run next to the storage. Review request handling for Cloudflare-specific behavior such as edge caching and header handling, because those features do not transfer. Test each route with production-like requests before you remove the binding. Confirm binding behavior and any remaining Workers dependencies with Cloudflare's Workers documentation.

Cloudflare logs and analytics

Request logs, storage metrics and usage analytics that Cloudflare keeps for R2 do not export with the objects. Auditors and incident responders may still ask for access history covering the period before cutover, so export or archive what you need while the account is still active. On the target, decide where access logs will come from, such as the object gateway logs or a reverse proxy, and set retention to match your policy. Confirm which log types Cloudflare makes available and for how long with its R2 documentation before you close the account.

Bucket lock and retention settings

R2 bucket locks are configured on the Cloudflare side and do not copy with the objects, so retention rules must be rebuilt on the target. Check the retention period and scope of each lock before the last copy, and confirm whether the target supports versioning and Object Lock for the same buckets. Garage does not implement object lock or versioning, so any bucket that needs those guarantees should target Ceph RGW or be handled another way. Confirm the lock behavior with Cloudflare and the target's retention features before you delete the source data.

S3 Object Lock guide

How the export path moves data from R2 to your target storage

The path starts with an inventory of buckets, objects and bucket lock rules, then runs an rclone job that reads R2 through its S3 endpoint using a read-only token. The copy crosses the trust boundary into your network and writes to the target store, which can be Ceph RGW, SeaweedFS S3 or Garage. Before cutover, compare object counts and checksums between source and target, because a copy that finishes without errors can still be incomplete.

Export copies objects from R2 into your network, then verifies them before cutover.

How to export data from R2 in a complete run, verified before cutover

This sequence copies every R2 bucket to the target store, proves the copy matches the source, and leaves a retained evidence record before any traffic moves.

  1. Inventory buckets, jurisdictions and retention settings

    Platform or storage owners list every R2 bucket, its object count and total size, any jurisdiction setting, custom domains, lifecycle rules, and any bucket lock or retention rules that apply. Record which applications, backup jobs and Workers read or write each bucket, because those become the cutover list. Confirm lock rules in the Cloudflare dashboard or API output rather than from memory, since R2's lock behavior differs from S3 Object Lock and must be rebuilt on the target as a separate decision. The step is done when every bucket has a row in a written inventory that the migration owner has signed off.

  2. Freeze writes or plan a delta sync

    Decide, per bucket, whether writes can pause during the copy. For buckets that cannot pause, the team agrees a delta sync: a first full copy, then repeated incremental runs that pick up changes until a short final window closes the gap. Identify the producers that write to each bucket, including Workers, uploads and scheduled jobs, and stop or redirect them where the business allows. The output is a written write-path decision for each bucket, approved by the application owners, so nobody is surprised by objects that appear after the last copy.

  3. Create a read-only R2 token

    The storage administrator creates an R2 API token scoped to read access on only the buckets in the inventory, and stores its access key and secret in the team's secrets manager, not in shell history or repository files. Keep the token separate from the tokens used by production applications so the copy cannot change source data. Confirm the token's permissions by listing one bucket and attempting a write, which should fail. The step closes when the read-only token works for listing and reading and is recorded in the migration runbook with its owner and expiry plan.

  4. Run rclone copy with checksum comparison

    Configure an rclone remote for R2 over the S3 API using the read-only token, and a second remote for the target endpoint, such as Ceph RGW or SeaweedFS S3. Run rclone copy with checksum comparison per bucket, logging to a file with --log-file and a verbose level so each transfer is recorded. Because the data leaves Cloudflare through the S3 API from your own network, the copy itself does not depend on a Cloudflare egress charge, though your bandwidth and the target's ingest costs still apply. Confirm the R2 endpoint and jurisdiction-specific hostname for each bucket before running, since the wrong endpoint returns errors or the wrong data. The step is done when every bucket's job exits cleanly and the log shows no unresolved transfer errors.

  5. Verify counts, sizes and sampled checksums

    Compare object counts and total bytes per bucket between source and target, using rclone size or a listing diff on both sides. Then run rclone check on the buckets and draw a random sample of objects for checksum comparison, with extra attention to large objects, small objects and key names with unusual characters. Investigate any mismatch before continuing, and re-run the affected prefixes if needed. Record the mismatch count, the sample size and the method used. The step closes when every bucket shows matching counts and sizes and the checks report no differences, or when each exception has a documented explanation and resolution.

  6. Keep the source untouched until the target passes

    Leave the R2 buckets, their lock settings and the read-only token in place after the copy, and do not delete or modify source objects during verification. Run a final delta copy if writes continued during the window, then repeat the count and checksum checks on the affected buckets. Applications continue reading from R2 until the target has passed every check, so rollback stays simple. The step is complete when the migration owner confirms in writing that the target matches the agreed inventory and that the source remains the authoritative copy until cutover.

  7. Switch endpoints and retire the source

    Update application configuration, backup jobs, custom domains and Workers bindings to point at the target endpoints, one bucket group at a time, and watch error rates and access logs after each change. Replacing Workers bindings and public bucket domains is a separate workstream covered in the migration guidance for each target. Once the new paths have run through a period the team agreed in advance, revoke the read-only token, and decide with the data owners when to delete the R2 buckets. The step closes when no production path still reads R2 and the retirement decision is recorded.

  8. Save the verification evidence

    Archive the inventory, the write-path decision, the rclone job logs, the listing and size diffs, the checksum reports, the sample lists and the approvals as one dated record. Store the record in a system with retention and access control that matches your data classification, and link it from the change ticket. Auditors, security reviewers and the team that retires R2 will ask for this evidence, so keep it readable without the original engineers. The step is done when the record is stored, its location is recorded in the retirement checklist, and the owner confirms it can be retrieved.

Rebuilding jurisdiction endpoints, public buckets and Workers bindings

Buckets created with a jurisdiction restriction are reached through a jurisdiction-specific endpoint, so an export client pointed at the default endpoint may not see them or may fail to read them. The copy has to read from the endpoint that matches each bucket, and the target has to sit where the residency rule says the data may live. An EU-restricted bucket copied to a cluster outside the EU breaks the rule even when the transfer itself succeeds.

  • Endpoint per bucket: Configure one rclone remote for each jurisdiction endpoint and map every bucket to the remote that serves it. Confirm the exact endpoint names in Cloudflare's R2 documentation for your account.
  • Target location: Place the Ceph, SeaweedFS or Garage cluster in the data centers the residency requirement names, such as your own EU sites for an EU rule.
  • Transit path: Confirm where the machine running the copy sits, since object data passes through it during transfer.
  • Verification by bucket: Compare object counts, sizes and checksums after each pass, and record which endpoint each source came from.
  • Audit record: Keep a per-bucket log of source endpoint, target cluster and physical location for your compliance file.

Confirm with your compliance owner which jurisdiction applies to each bucket before the first copy run.

Why bucket lock rules need an inventory before the copy starts

Start the copy only after you have listed every bucket and recorded any retention or lock rule attached to it. R2 has its own bucket lock feature, which is a separate control from S3 Object Lock. The Amazon S3 user guide describes S3 Object Lock as a write-once-read-many model with governance and compliance retention modes and legal holds, and it works only in versioned buckets. R2's S3 API does not implement Object Lock or versioning, so a rule you can see in the Cloudflare dashboard may not map to any setting on the target. Export the rule names, the prefixes they cover, their durations and whether they apply to all objects or only some. Record which teams depend on them, because the rule is often the only evidence that data was kept unchanged for a required period.

CIS Controls v8.1 Safeguard 11.4 asks for an isolated instance of recovery data, with offline, cloud or off-site version-controlled backups as example implementations. A copy in your own infrastructure can meet that intent, but only if the target gives you the retention guarantees the data needs. Garage does not implement object versioning, object locking or bucket policies, so a Garage bucket cannot hold objects immutable for a set period. Ceph RGW supports versioned buckets and Object Lock, which the Ceph documentation covers under its S3 API reference. Confirm with your backup and compliance owners which guarantees each bucket requires, then check those guarantees on the chosen target before you delete anything from R2.

Use the inventory as a decision list. For each bucket, mark whether it needs immutability, whether a backup tool writes to it with versioning enabled, and whether a copy elsewhere would count as the isolated recovery copy. Buckets that need immutability move to a target that provides it, and the rest can follow a simpler plan. Keep the source bucket and its rules unchanged until the copy is verified and the target's retention behavior has been tested with a sample object. An illustrative example: a backup bucket with a 90-day compliance-style rule in R2 may need a Ceph target with Object Lock configured in a versioned bucket, while a static asset bucket may only need a checksum comparison after rclone finishes.

What to plan before the R2 contract ends

An R2 exit is mostly a sequence of decisions that depend on your Cloudflare terms, your target platform and your own staff. The cards below cover the items to settle before the contract end date, in roughly the order they affect the schedule.

Notice and retention terms

Read the notice period, termination clauses and any data retention or deletion terms in your Cloudflare agreement, and confirm them in writing with Cloudflare. Find out how long objects remain recoverable after termination and whether any backup or log copies persist. These terms set your latest possible cutover date, so work backward from them before choosing a target platform.

Target platform and staffing

Choose between Ceph RGW, SeaweedFS and Garage based on the features your buckets use, such as versioning, Object Lock, bucket policies and public access. Confirm who will operate the cluster after cutover, including on-call coverage for drive failures and upgrades. Ceph needs the most operational staff, so decide on staffing before you commit to a design.

Parallel-run window

Plan a period where both R2 and the new store serve the same buckets, so applications can be tested against the self-hosted endpoint before traffic moves. Decide which writes go to which side during that window and how you will reconcile objects written late in the period. Ask your application owners how long they need to validate reads, writes and presigned URL behavior.

Key and token retirement

Inventory every R2 API token, S3 access key and Workers binding that can reach a bucket, then map each one to a new RGW user, SeaweedFS key or Garage access key with per-bucket permissions. Retire the old credentials only after the last application has switched, and record who approved each retirement. Missed credentials are a common reason an exit leaves access open after the contract ends.

DNS and certificate cutover

List every hostname that points to R2, including custom domains, public bucket domains and any endpoint names used by backup jobs or CDN origins. Issue TLS certificates for the new endpoints ahead of time and lower DNS TTLs before the switch so rollback is quick. Confirm that clients validate the new certificate chain and that path-style or virtual-host-style URLs resolve as expected.

Deletion evidence and final verification

Define what counts as a completed exit before the contract ends: object counts and checksums matched between source and target, then a written record of deletion from R2 and of retained copies. Ask your compliance team which evidence they need, such as rclone check output and deletion confirmations, and keep it with the change record. Recovery and retention controls in the new store should follow the same standard you used for R2.

How much effort does it take to export data from R2?

How long does it take to export data from Cloudflare R2?

The duration depends on three things: total bytes, object count and the bandwidth available from the machine running the copy to R2 and to the target. Object count matters as much as size, because listing and per-object overhead grow with the number of keys, and many small files take longer than a few large ones of the same total size. The practical way to estimate is to benchmark a representative sample bucket first, run the same transfer tool from the location you plan to use, and extrapolate from measured throughput. Ask any partner to base its schedule on that measurement rather than on a generic figure.

What costs should we expect when moving data out of R2?

Expect four cost components. Staff time covers the inventory of buckets, public domains and lock rules, the copy runs, and rebuilding access on the new platform. Target infrastructure is either hardware and drives for a self-hosted cluster or, if you use a managed provider, its subscription. Bandwidth from the run location is a separate line, and R2 does not charge egress fees, so confirm how your run location and target network are billed. Finally, R2 Class A and Class B operations apply to listing and reading objects during the export, so check the current operation rates on Cloudflare's pricing page and estimate them from your object count.

Can our own engineers export R2 data without outside help?

Yes, for simple cases. A team that has a small number of buckets, no public bucket domains, no Workers reading through bindings and no bucket lock rules can usually run rclone against the S3 API, verify checksums and switch endpoints. The work gets harder when buckets carry retention or lock rules that must be rebuilt on the target, when objects must stay in a specific jurisdiction, or when many applications read through Workers code that needs replacing. Those cases need owners across several teams and a clear verification plan, which is where outside planning and testing usually pays off.

What do we need to provide before an export starts?

Plan for four inputs. First, administrative access to the Cloudflare accounts that hold the buckets, including the ability to create and rotate R2 API tokens. Second, a named owner for each application or pipeline that reads or writes those buckets, because they will need to approve endpoint changes. Third, a list of public domains, Workers routes and bindings. Fourth, a verification sign-off: someone accountable for accepting the copy, usually by comparing object counts, sizes and checksums per bucket and confirming test reads from each application. Without these, the copy may finish while the migration remains unfinished.

What should we verify before a fixed-scope migration quote?

Ask the provider to put the following in writing: the bucket and object inventory it assumed, the list of applications and Workers in scope, how lock rules and retention will be rebuilt, the tool and transfer method, the verification method and acceptance criteria, the rollback plan for endpoint switches, and what happens to access keys and public domains. Ask which costs are included, which are your responsibility (bandwidth, hardware, Cloudflare operation charges) and what a change to scope would cost. A fixed-scope quote should name deliverables and dates in the same document.

Does a jurisdiction-restricted R2 bucket change the export work?

Yes. Buckets created for a specific jurisdiction use their own endpoints, so the copy tool must target the correct jurisdiction-specific address, and the destination must meet the same residency requirement. Confirm the endpoint format and the destination location with Cloudflare's documentation and with your compliance team before scheduling runs, since copying data through a run location outside the required region can create a residency question of its own. Record where each run executes and where the data lands, so the audit trail matches the requirement.

What checks show the export is complete and correct?

Compare object counts, total bytes and per-object checksums between the source and target for each bucket, then run test reads from every application that depended on R2. Check that content types, metadata and key names survived the copy, because some tools and target stores handle them differently. Where R2 lock rules or retention policies existed, verify that the equivalent protection is in place on the target before you retire the source. Keep the verification output as evidence for the change record.

How DeployOpen scopes, delivers and supports an R2 exit

DeployOpen is a Chainscore Labs company that plans, implements, integrates, backs up, documents and supports self-hosted open-source platforms inside your own cloud accounts, data centers or air-gapped networks. For an R2 exit, we agree the scope in writing before any data moves, then deliver the inventory, export, endpoint changes and cutover evidence that your team needs to sign off.

How we scope

  • Inventory every R2 bucket, custom domain, r2.dev access path and Worker binding that reads or writes objects
  • Record which buckets use retention or bucket lock rules, and which tools depend on S3 versioning or Object Lock
  • Confirm the jurisdiction setting for each bucket and the target location for the replacement cluster
  • Agree in writing which target platform (Ceph, SeaweedFS or Garage) fits each workload before work starts

How we build

  • Stand up the chosen target in your infrastructure with access keys mapped to your existing access model
  • Run rclone copies over the S3 API with checksums and object counts compared between source and destination
  • Rebuild retention requirements as settings the target actually supports, and document any gap in writing
  • Replace Workers bindings and public access paths with the edge or gateway components agreed in scope

How we hand over

  • Deliver a written runbook covering the export procedure, endpoint changes, key rotation and rollback steps
  • Provide a verification report listing buckets, object counts, checksum results and any objects that failed to copy
  • Document hardening, backup destinations and access controls so your security and compliance teams can review them
  • Walk your operators through the cluster so they can run the day-to-day tasks after handover

How we support

  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts
  • Ongoing support, upgrades, backups and continuous testing are available as a retainer after handover
  • Security testing of the new storage endpoints can be scoped separately, with a findings report and retest
  • Ask your quote to separate one-time migration work from recurring retainer and operations effort

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.