Home / OCI

OCIHow-toBeginner

OCI Object Storage cross-region replication for DR

Create a replication policy from a source bucket to a DR-region bucket, set the required IAM policy, monitor last sync, and stop replication to make the destination writable during failover.

Deepak Bhardwaj2 min read

Applies toOCI Object Storage replication policies

How it works

  • Asynchronous, one-way replication of objects from a source bucket to a destination bucket in another region (or the same region).
  • The destination bucket is read-only while it's a replication target.
  • Only objects created after the policy are replicated. Copy existing objects separately (bulk copy, oci os object copy, or rclone).

1. IAM policy for the service

Object Storage needs permission to manage objects in both regions:

Allow service objectstorage-ap-mumbai-1 to manage object-family in compartment cmp-payments-prod

(Use the service name for the source region.)

2. Create the destination bucket

In Hyderabad, same compartment structure, versioning and encryption settings as the source. With customer-managed keys, the destination bucket uses a key in the DR region's Vault.

3. Create the policy

oci os replication create-replication-policy --bucket-name invoices-prod \
  --name invoices-to-hyd --destination-region ap-hyderabad-1 --destination-bucket invoices-prod-dr
oci os replication list-replication-policies --bucket-name invoices-prod --output table

4. Copy existing objects

# server-side copy, one object (no download through your machine)
oci os object copy --bucket-name invoices-prod --source-object-name 2026/10/inv-1.pdf \
  --destination-region ap-hyderabad-1 --destination-bucket invoices-prod-dr

For large buckets, script server-side copies (no download) or use rclone with the OCI backend.

5. Monitor

oci os replication get-replication-policy shows status and time last sync. Alert when it's older than the RPO.

6. Failover

  1. Delete the replication policy (or stop it) to make the destination bucket writable.
  2. Point applications at the DR bucket (namespace + bucket name in config, or a DNS/config switch).
  3. After the primary region returns, set up replication in the reverse direction and copy back changes.

Limits to remember

  • Deletes of objects are replicated; this isn't a backup.
  • Retention rules on the destination must be compatible with replication (check documentation before enabling both).
  • Replication is asynchronous; very recent objects might not be in DR yet.

Tip

Store the DR bucket name in configuration from day one (STORAGE_BUCKET, STORAGE_REGION). Switching then becomes a config change, not a code release during an outage.