# Backing up files in Object Storage

**URL:** https://meta.discourse.org/t/backing-up-files-in-object-storage/174630
**Category:** Support
**Created:** [December 30, 2020, 6:44pm UTC](https://meta.discourse.org/t/backing-up-files-in-object-storage/174630 "2020-12-30T18:44:47Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![TheDarkWizard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thedarkwizard/32/177913_2.png) [@TheDarkWizard](https://meta.discourse.org/u/TheDarkWizard)
#### Post date: [December 30, 2020, 6:44pm UTC](https://meta.discourse.org/t/backing-up-files-in-object-storage/174630/1 "2020-12-30T18:44:47Z")

</div>

So, I wanted to pick at the brains of any team members floating around or other community users about a use case I have: I want to use Object Storage on Discourse but I need the attachments to also be moved to a second object storage provider so that we have a backup of the data in a second entity as part of following the 3:2:1 rule.

I know that Discourse itself can’t handle this, so I just wanted some ideas as to how I should follow up on this once the files are on object storage. If it matters, I might use Backblaze as per this topic: [Configure an S3 compatible object storage provider for uploads](https://meta.discourse.org/t/using-object-storage-for-uploads-s3-clones/148916) and I might use S3 as the secondary location. Should some sort of script be created that communicates via the APIs of both services, or is this something I can setup on S3 (having it pull from another location).

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [December 30, 2020, 6:48pm UTC](https://meta.discourse.org/t/backing-up-files-in-object-storage/174630/2 "2020-12-30T18:48:53Z")

</div>

If you are using the real S3, this is something it has native support:

> **[Replicating objects within and across Regions - Amazon Simple Storage Service](https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication.html)**
>
> Set up and configure replication to allow automatic, asynchronous copying of objects across Amazon S3 buckets.

This is a responsibility of the Object Storage service, so I assume all “good” clones should offer similar functionality.

---

<div class="post-metadata">

### Author: ![TheDarkWizard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thedarkwizard/32/177913_2.png) [@TheDarkWizard](https://meta.discourse.org/u/TheDarkWizard)
#### Post date: [December 30, 2020, 6:51pm UTC](https://meta.discourse.org/t/backing-up-files-in-object-storage/174630/3 "2020-12-30T18:51:55Z")

</div>

I was looking at that, but it doesn’t seem like I can use it to replicate outside of Amazon S3 into say Linode Object Storage or Backblaze.

The goal was to make sure that the data existed somewhere else apart from one just provider so that no provider could take your data hostage by shutting down an account in error or some such.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [December 30, 2020, 6:57pm UTC](https://meta.discourse.org/t/backing-up-files-in-object-storage/174630/4 "2020-12-30T18:57:49Z")

</div>

Sounds like a job for a Lambda then. You can write a script that triggers on upload and puts the recently touched file elsewhere.

> **[Process Amazon S3 event notifications with Lambda - AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/with-s3.html)**
>
> Use Lambda to process event notifications from Amazon S3.

---

<div class="post-metadata">

### Author: ![TheDarkWizard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thedarkwizard/32/177913_2.png) [@TheDarkWizard](https://meta.discourse.org/u/TheDarkWizard)
#### Post date: [December 30, 2020, 6:58pm UTC](https://meta.discourse.org/t/backing-up-files-in-object-storage/174630/5 "2020-12-30T18:58:33Z")

</div>

Will take a look thanks!
