# REQ: Support S3 backup to a service like Backblaze

**URL:** https://meta.discourse.org/t/req-support-s3-backup-to-a-service-like-backblaze/162196
**Category:** Support
**Created:** [August 27, 2020, 4:44am UTC](https://meta.discourse.org/t/req-support-s3-backup-to-a-service-like-backblaze/162196 "2020-08-27T04:44:27Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![frold](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frold/32/82547_2.png) [@frold](https://meta.discourse.org/u/frold)
#### Post date: [August 27, 2020, 4:44am UTC](https://meta.discourse.org/t/req-support-s3-backup-to-a-service-like-backblaze/162196/1 "2020-08-27T04:44:27Z")

</div>

I would like support of backup to a backblaze destination.

At the moment Im not able to set a endpoint like: [s3.eu-central-003.backblazeb2.com](http://s3.eu-central-003.backblazeb2.com)

---

<div class="post-metadata">

### Author: ![markersocial](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markersocial/32/170136_2.png) [@markersocial](https://meta.discourse.org/u/markersocial)
#### Post date: [August 27, 2020, 6:11am UTC](https://meta.discourse.org/t/req-support-s3-backup-to-a-service-like-backblaze/162196/2 "2020-08-27T06:11:38Z")

</div>

Just in case you haven’t seen this: [Configure an S3 compatible object storage provider for uploads](https://meta.discourse.org/t/using-object-storage-for-uploads-s3-clones/148916#backblaze-b2-cloud-storage)

---

<div class="post-metadata">

### Author: ![frold](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frold/32/82547_2.png) [@frold](https://meta.discourse.org/u/frold)
#### Post date: [August 27, 2020, 7:39am UTC](https://meta.discourse.org/t/req-support-s3-backup-to-a-service-like-backblaze/162196/3 "2020-08-27T07:39:20Z")

</div>

Nope I had not… Now I have 🙂

But then again you need a ph.d to be able to do a simple thing. For futrure release Admin Usability could be an issue.

Discourse have many advance features - but they are also too advance to use for an average user (me :🙂 )

---

<div class="post-metadata">

### Author: ![frold](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frold/32/82547_2.png) [@frold](https://meta.discourse.org/u/frold)
#### Post date: [August 27, 2020, 8:02am UTC](https://meta.discourse.org/t/req-support-s3-backup-to-a-service-like-backblaze/162196/4 "2020-08-27T08:02:03Z")

</div>

By the way - I only want the backup to be stored remote from the server.

No need for upload like images etc is stored on a CDN. My forum is not that big or have that high usage…

Its on a simple 5 dollars droplet…

---

<div class="post-metadata">

### Author: ![markersocial](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markersocial/32/170136_2.png) [@markersocial](https://meta.discourse.org/u/markersocial)
#### Post date: [August 27, 2020, 8:21am UTC](https://meta.discourse.org/t/req-support-s3-backup-to-a-service-like-backblaze/162196/5 "2020-08-27T08:21:12Z")

</div>

Oh, that should be quite simple then. Though if it’s not too big, maybe it’s just less hassle to use AWS S3? Their pricing isn’t too bad for storage, it’s just kind of hectic for bandwidth.

I think you’d just need to put this in your app.yml with the correct info and rebuild. It’s excluding the parts that are for user uploads. You wouldn’t need to include the `after_assets_precompile` other part from the tutorial.

Just SSH into your server as root then run:  
cd /var/discourse  
nano containers/app.yml

Use the keyboard arrows to move the curser around and paste in the info below underneath the part of the file that says: `#DISCOURSE_CDN_URL: https://discourse-cdn.example.com`

```plaintext
  DISCOURSE_S3_REGION: "us-west-002"
  DISCOURSE_S3_INSTALL_CORS_RULE: false
  DISCOURSE_S3_ENDPOINT: https://s3.us-west-002.backblazeb2.com
  DISCOURSE_S3_ACCESS_KEY_ID: myaccesskey
  DISCOURSE_S3_SECRET_ACCESS_KEY: mysecretkey
  DISCOURSE_S3_BACKUP_BUCKET: falcoland-files/backup
  DISCOURSE_BACKUP_LOCATION: s3

```

Make sure you’ve put the correct info in for the region, endpoint, access key, secret key and backup bucket name.

Press ctrl+o and confirm to save, then press ctrl+x to exit. Then run:  
./launcher rebuild app

Fairly confident it should work fine.

Seeing you are on Digital Ocean, it’d be a good idea to make a backup before you do this though. So rolling back is easy if something goes wrong.

---

<div class="post-metadata">

### Author: ![frold](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frold/32/82547_2.png) [@frold](https://meta.discourse.org/u/frold)
#### Post date: [August 27, 2020, 9:30am UTC](https://meta.discourse.org/t/req-support-s3-backup-to-a-service-like-backblaze/162196/6 "2020-08-27T09:30:09Z")

</div>

Thanks for the description @markersocial

I did go to [Sign In](https://secure.backblaze.com/b2_buckets.htm) and created a new bucket

I then went to App Keys to create a new app key for access

After the creation you temporary gets an info like below - be aware you only see this once:

 ![Skærmbillede 2020-08-27 kl. 10.49.20](https://global.discourse-cdn.com/meta/original/3X/f/6/f6c819b057832c10f60bbf4e7ef3584bdb2d835e.png)

Based and that I used:

> DISCOURSE\_S3\_REGION: “s3.eu-central-003”  
> DISCOURSE\_S3\_INSTALL\_CORS\_RULE: false  
> DISCOURSE\_S3\_ENDPOINT: [https://s3.eu-central-003.backblazeb2.com](https://s3.eu-central-003.backblazeb2.com)  
> DISCOURSE\_S3\_ACCESS\_KEY\_ID: myaccesskey  
> DISCOURSE\_S3\_SECRET\_ACCESS\_KEY: mysecretkey  
> DISCOURSE\_S3\_BACKUP\_BUCKET: my\_buckets\_Name  
> DISCOURSE\_BACKUP\_LOCATION: s3

Then I did a rebuild after I did make a snapshot of my droplet at digital ocean

> ./launcher rebuild app

I then went to `/admin/backups` and made a backup

> [2020-08-27 09:25:57] Creating archive: studmed-dk-2020-08-27-092518-v20200820232017.tar.gz  
> [2020-08-27 09:25:57] Making sure archive does not already exist…  
> [2020-08-27 09:25:57] pg\_dump: executing SEQUENCE SET topic\_allowed\_users\_id\_seq  
> [2020-08-27 09:25:57] Creating empty archive…  
> [2020-08-27 09:25:57] Archiving data dump…  
> [2020-08-27 09:25:59] Archiving uploads…  
> [2020-08-27 09:26:06] Removing tmp ‘/var/www/discourse/tmp/backups/default/2020-08-27-092518’ directory…  
> [2020-08-27 09:26:06] Gzipping archive, this may take a while…  
> [2020-08-27 09:26:31] Uploading archive…  
> [2020-08-27 09:26:41] Executing the after\_create\_hook for the backup…  
> [2020-08-27 09:26:41] Deleting old backups…  
> [2020-08-27 09:26:41] Cleaning stuff up…  
> [2020-08-27 09:26:41] Removing archive from local storage…  
> [2020-08-27 09:26:41] Removing ‘.tar’ leftovers…  
> [2020-08-27 09:26:41] Marking backup as finished…  
> [2020-08-27 09:26:41] Refreshing disk stats…  
> [2020-08-27 09:26:42] Notifying ‘frold’ of the end of the backup…  
> [2020-08-27 09:26:53] Finished!

Then I went to backblaze to see if anything happend there:

 ![Skærmbillede 2020-08-27 kl. 11.28.51](https://global.discourse-cdn.com/meta/original/3X/1/b/1b0ed6c2a8f511d181e461796c0bb8063ff4ad67.png)

I owe you a 🍻

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [August 27, 2020, 9:39pm UTC](https://meta.discourse.org/t/req-support-s3-backup-to-a-service-like-backblaze/162196/7 "2020-08-27T21:39:46Z")

</div>

Nice work! If anyone else stumbles here, I believe that if you provide a key that can create buckets, discourse will even create the bucket for you.

---

<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: [August 27, 2020, 11:08pm UTC](https://meta.discourse.org/t/req-support-s3-backup-to-a-service-like-backblaze/162196/8 "2020-08-27T23:08:31Z")

</div>

Closing as this is supported out of the box by following [Using Object Storage for Uploads (S3 & Clones)](https://meta.discourse.org/t/using-object-storage-for-uploads-s3-clones/148916)

---

<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: [August 27, 2020, 11:08pm UTC](https://meta.discourse.org/t/req-support-s3-backup-to-a-service-like-backblaze/162196/9 "2020-08-27T23:08:33Z")

</div>


