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 Likes

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 Likes