Object Replication With the Wasabi S3 API

Prev Next

Object replication enables you to replicate or copy your data between Wasabi regions to protect against ransomware attacks, malicious data manipulation, natural disasters, or even accidental deletion. Object replication enables you to replicate/copy objects from an active storage bucket (source) to one or more different buckets (destination).

PUT Object Replication

Wasabi supports functionality for replication configuration with:

  • One source and one destination bucket (without filters)

  • One source and one destination bucket (with filters)

  • One source and multiple destination buckets

In addition, Wasabi supports functionality for updating an existing replication configuration.

Replication Configuration With One Source and One Destination Bucket (Without Filters)

PUT https://s3.<region>.wasabisys.com/my-replication-source?replication

Request body:

<?xml version="1.0" encoding="UTF-8"?>
<ReplicationConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <Role></Role>
    <Rule>
        <ID>job1</ID>
        <Priority>1</Priority>
        <Status>Enabled</Status>
        <DeleteMarkerReplication>
            <Status>Enabled</Status>
        </DeleteMarkerReplication>
        <Destination>
            <Bucket>arn:aws:s3:::my-replication-destination</Bucket>
        </Destination>
        <Filter>

      </Filter>
    </Rule>
</ReplicationConfiguration>

Status: 200 OK

Notes:

  1. Make sure both the source and destination buckets match the same bucket-property while scheduling the replication configuration.

    1. Non-versioned source —> Non-versioned destination

    2. Versioned source —> Versioned destination

  2. Only new objects (uploaded after scheduling the replication configuration) will be replicated to the destination bucket.

  3. To replicate the existing objects from the source to the destination, you need to initiate the following API only after scheduling the replication configuration.

PUT https://s3.<region>.wasabisys.com/my-replication-source?manifestCreateAndProcess

Response body:

<?xml version="1.0" encoding="UTF-8"?>

<ManifestCreateAndProcess>jobId : DHZsWBhwMUg9euZyFg7eahv4</ManifestCreateAndProcess>

Status: 200 OK

Replication Configuration With One Source and One Destination Bucket (With Filters)

In this example, objects that satisfy both conditions (prefix as AA- and tag “key1-value1”) will be replicated to the destination bucket.

PUT https://s3.<region>.wasabisys.com/my-replication-source?replication

Request body:

<?xml version="1.0" encoding="UTF-8"?>
<ReplicationConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
   <Role></Role>
   <Rule>
      <ID>job1</ID>
      <Priority>1</Priority>
      <Status>Enabled</Status>
      <DeleteMarkerReplication>
         <Status>Disabled</Status>
      </DeleteMarkerReplication>
      <Destination>
         <Bucket>arn:aws:s3:::my-replication-destination</Bucket>
      </Destination>
      <Filter>
           <And>
                <Prefix>AA-</Prefix>
                <Tag>
                     <Key>key1</Key>
                     <Value>value1</Value>
                </Tag>
           </And>
      </Filter>
   </Rule>
</ReplicationConfiguration>

Status: 200 OK

Replication Configuration With One Source and Multiple Destinations

PUT https://s3.<region>.wasabisys.com/my-replication-source?replication

Request body:

<?xml version="1.0" encoding="UTF-8"?>
<ReplicationConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
   <Role></Role>
   <Rule>
      <ID>job1</ID>
      <Priority>1</Priority>
      <Status>Enabled</Status>
      <DeleteMarkerReplication>
         <Status>Enabled</Status>
      </DeleteMarkerReplication>
      <Destination>
         <Bucket>arn:aws:s3:::my-replication-destination-1</Bucket>
      </Destination>
      <Filter></Filter>
   </Rule>
   <Rule>
      <ID>job2</ID>
      <Priority>1</Priority>
      <Status>Enabled</Status>
      <DeleteMarkerReplication>
         <Status>Enabled</Status>
      </DeleteMarkerReplication>
      <Destination>
         <Bucket>arn:aws:s3:::my-replication-destination-2</Bucket>
      </Destination>
      <Filter></Filter>
   </Rule>
</ReplicationConfiguration>

Status: 200 OK

Updating an Existing Replication Configuration

The replication configuration will replace an existing configuration. In this example, an existing replication configuration maps job2 to my-replication-destination-2, and the update changes the replication configuration to map job2 to my-replication-destination-3.

PUT https://s3.<region>.wasabisys.com/my-replication-source?replication

Request body:

<?xml version="1.0" encoding="UTF-8"?>
<ReplicationConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
   <Role></Role>
   <Rule>
      <ID>job1</ID>
      <Priority>1</Priority>
      <Status>Enabled</Status>
      <DeleteMarkerReplication>
         <Status>Enabled</Status>
      </DeleteMarkerReplication>
      <Destination>
         <Bucket>arn:aws:s3:::my-replication-destination-1</Bucket>
      </Destination>
      <Filter></Filter>
   </Rule>
   <Rule>
      <ID>job2</ID>
      <Priority>1</Priority>
      <Status>Enabled</Status>
      <DeleteMarkerReplication>
         <Status>Enabled</Status>
      </DeleteMarkerReplication>
      <Destination>
         <Bucket>arn:aws:s3:::my-replication-destination-3</Bucket>
      </Destination>
      <Filter></Filter>
   </Rule>
</ReplicationConfiguration>

Status: 200 OK

GET Object Replication

GET https://s3.<region>.wasabisys.com/my-replication-source?replication

Response body:

<?xml version="1.0" encoding="UTF-8"?>
<ReplicationConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
   <Role></Role>
   <Rule>
      <ID>job1</ID>
      <Priority>1</Priority>
      <Status>Enabled</Status>
      <DeleteMarkerReplication>
         <Status>Enabled</Status>
      </DeleteMarkerReplication>
      <Destination>
         <Bucket>arn:aws:s3:::my-replication-destination</Bucket>
      </Destination>
      <Filter></Filter>
   </Rule>
</ReplicationConfiguration>

Status: 200 OK

DELETE Object Replication

You can delete the existing replication configuration of the bucket. This removes the entire replication configuration from the specified bucket.

DELETE https://s3.<region>.wasabisys.com/my-replication-source?replication

Status: 204 No Content

Response body: No content