# Use Google Cloud Storage Instead of S3

**URL:** https://meta.discourse.org/t/use-google-cloud-storage-instead-of-s3/40046
**Category:** Feature
**Created:** [23.Февраль.2016 17:19:28 UTC](https://meta.discourse.org/t/use-google-cloud-storage-instead-of-s3/40046 "2016-02-23T17:19:28Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![yyhmsg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yyhmsg/32/115542_2.png) [@yyhmsg](https://meta.discourse.org/u/yyhmsg)
#### Post date: [23.Февраль.2016 17:19:28 UTC](https://meta.discourse.org/t/use-google-cloud-storage-instead-of-s3/40046/1 "2016-02-23T17:19:28Z")

</div>

I saw another post about this from '14 - but no answer and it seemed like they were making this harder than it should be…

I would like some pointers to see if there is an AWS endpoint configuration within app.yml which could be changed to allow use of google cloud storage instead of s3 - GCS has a compatability mode where all - as I understand it - would need to happen is to change the AWS endpoint:

> **[Fully migrate from Amazon S3 to Cloud Storage  |  Google Cloud Documentation](https://docs.cloud.google.com/storage/docs/migrating)**

> In your existing tools or libraries, make the following changes:  
> Change the request endpoint to use the Google Cloud Storage request endpoint.  
> Replace the Amazon Web Services (AWS) access and secret key with the corresponding Google Cloud Storage access key and secret key (collectively called your Google developer key).

This could be added as an option under /admin/site\_settings/category/files and option for AWS endpoint along with the access keys? or can it be done in the app.yml? [AWS\_ENDPOINT = “/xxxx/xxx”] already?

Thanks!

---

<div class="post-metadata">

### Author: ![yyhmsg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yyhmsg/32/115542_2.png) [@yyhmsg](https://meta.discourse.org/u/yyhmsg)
#### Post date: [24.Февраль.2016 22:02:13 UTC](https://meta.discourse.org/t/use-google-cloud-storage-instead-of-s3/40046/2 "2016-02-24T22:02:13Z")

</div>

I ended up doing this, just to get it working:

```
/bin/bash
 This script will copy the latest discourse backup to google cloud
 Then it will remove the previous backup from google cloud

LATESTBACKUP=`ls /var/discourse/shared/standalone/backups/default/*.gz -t1 | head -n1`
PREVBACKUPWDIR=`ls /var/discourse/shared/standalone/backups/default/*.gz -1tr | head -1`
PREVBACKUP=`find $PREVBACKUPWDIR -exec basename {} \;`

/home/user/gsutil/gsutil cp $LATESTBACKUP gs://yyh-community-backups
/home/user/gsutil/gsutil rm gs://your-backup-bucket/$PREVBACKUP

```

Which works, but I still think greater use of google cloud storage could be used with the s3 compatibility mode as described above. But maybe I’m the only one who wants to use non amazon tools.

---

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [25.Февраль.2016 01:02:40 UTC](https://meta.discourse.org/t/use-google-cloud-storage-instead-of-s3/40046/3 "2016-02-25T01:02:40Z")

</div>

It’d be great to have a few options “out of the box”!

---

<div class="post-metadata">

### Author: ![tuanpembual](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tuanpembual/32/223553_2.png) [@tuanpembual](https://meta.discourse.org/u/tuanpembual)
#### Post date: [09.Август.2021 08:06:58 UTC](https://meta.discourse.org/t/use-google-cloud-storage-instead-of-s3/40046/4 "2021-08-09T08:06:58Z")

</div>

Привет

Я тестирую резервное копирование в GCS с использованием конфигурации по умолчанию.

```plaintext
DISCOURSE_S3_BACKUP_BUCKET: falcoland-files/backup
DISCOURSE_BACKUP_LOCATION: s3

```

Также добавил специальную политику для GCS:

```plaintext
policy = {
    "serviceAccount:${google_service_account.discourse.email}" = [
      "roles/storage.legacyBucketOwner"
    ]
  }

```

Резервное копирование успешно отправляется в GCS.

Надеюсь, это поможет кому-то, кто, как и я, потратил неделю на настройку.

[GCS Storage](https://meta.discourse.org/t/using-object-storage-for-uploads-s3-clones/148916#gcp-storage)

---

<div class="post-metadata">

### Author: ![Mark\_Schmucker](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mark_schmucker/32/124810_2.png) [@Mark\_Schmucker](https://meta.discourse.org/u/Mark_Schmucker)
#### Post date: [10.Август.2021 03:22:39 UTC](https://meta.discourse.org/t/use-google-cloud-storage-instead-of-s3/40046/5 "2021-08-10T03:22:39Z")

</div>

Это, вероятно, граничит с паранойей, но я храню резервные копии Discourse в AWS S3 (что поддерживается из коробки), а затем синхронизирую их с S3 в GCS с помощью:

> **[Storage Transfer Service | Google Cloud](https://cloud.google.com/storage-transfer-service)**
>
> Complete large-scale online data transfers from online and on-premises sources to Cloud Storage.

Программирование не требуется. Это немного увеличит ваши расходы на хранение, поэтому не поможет, если вы пытаетесь сэкономить. Я храню последние 10 резервных копий, каждая размером 10 ГБ, и это обходится мне в 3 доллара в месяц в Google.
