Configure automatic backups for Discourse

Yes. If backups are on S3 and you no longer want the backups on the local drive, you can delete them.

2개의 좋아요

Can I only enable S3 for backups but not files or images upload?

I had the exact same question, and could not find an explicit answer here or in Configure an S3 compatible object storage provider for uploads.

But, I’ve set up Scaleway S3 Object Storage for backups only with these environment variables, and it seems to work. I just made a manual backup to the bucket this way using the Admin dashboard.

# Leaving the below parameters commented out 
# because they configure S3 for uploads/CDN distribution, which we don't want.
# DISCOURSE_USE_S3: true
# DISCOURSE_S3_CDN_URL:
# DISCOURSE_S3_BUCKET: 
DISCOURSE_S3_REGION: nl-ams
DISCOURSE_S3_ENDPOINT: https://s3.nl-ams.scw.cloud
DISCOURSE_S3_ACCESS_KEY_ID: <redacted>
DISCOURSE_S3_SECRET_ACCESS_KEY: <redacted>
DISCOURSE_S3_BACKUP_BUCKET: <redacted>
DISCOURSE_BACKUP_LOCATION: s3

Static assets are still served from my VPS, as expected & desired, and I’m not seeing any errors. I’m not sure if the scheduled backups will work, but if the manual backup worked, they should too.

I’ll add a note to the wiki above that these parameters can be left out if you only want to use S3 for backups, and not for file or image uploads.
Update: it’s not a wiki.
Update 2: it was made a wiki at my request, thanks!

3개의 좋아요

여분 웹 컨테이너 2개를 사용 중이라면, 백업이 하나만 실행되도록 어떻게 보장할 수 있나요?

별도로 할 필요가 없습니다 - Discourse가 이를 자동으로 처리합니다. Sidekiq과 Redis는 작업을 한 번만 실행하며, Sidekiq은 웹 컨테이너 중 하나만 선택합니다. 다만 로컬 백업을 사용하는 경우에는 특정 백업 시점에 어떤 컨테이너에서 실행되는지 확신할 수 없습니다.

따라서 아직 그렇지 않다면 외부 S3 버킷을 사용해야 합니다. 그렇지 않으면 백업 파일이 두 컨테이너의 로컬 디스크에 무작위로 저장될 가능성이 높습니다. S3 버킷을 사용하면 백업이 항상 동일한 위치에 저장됩니다.

2개의 좋아요