# 🇨🇳 How to back up Discourse to S3 | How to back up Discourse to S3 in Chinese

**URL:** <https://meta.discourse.org/t/how-to-back-up-discourse-to-s3-discourse-s3/245552>\
**Category:** Sysadmins\
**Tags:** s3, chinese-translation\
**Created:** [November 14, 2022, 5:50pm UTC](https://meta.discourse.org/t/how-to-back-up-discourse-to-s3-discourse-s3/245552 "2022-11-14T17:50:23Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![honeymoose](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/honeymoose/32/198718_2.png) [@honeymoose](https://meta.discourse.org/u/honeymoose)\
**Post date:** [July 25, 2024, 11:24am UTC](https://meta.discourse.org/t/how-to-back-up-discourse-to-s3-discourse-s3/245552/4 "2024-07-25T11:24:59Z")

</div>

I haven’t carefully reviewed the backup content for Discourse.

After looking at our backups, I realized:

If your attachments are stored using AWS cloud storage, even if you select `Include attachments in backup` during backup, the attachments uploaded to AWS will not be included in your backup file.

The attachments within the backup are only those stored on your local computer, not the ones on AWS.

This can be seen from the size of our website backup. If attachments were included, the backup size would not be only 80+ MB.

This indicates that the backup only contains the database and local attachments.

Opening this downloaded file, you’ll see only 2 folders: one is `dump`, which is the PGSQL database dump file.

The other is the `uploads` folder, which contains only your locally uploaded attachments, not those stored on AWS. For us, this folder is very small with few files.

This is because we uploaded all attachments to AWS shortly after the community started running.

The image above shows the content of the PGSQL dump file. You can see the PGSQL version running in the current Discourse database container from the dump file.

If you want to view the database locally, this dump file can be directly imported into your local container.

### AWS Recovery Issues

If you use AWS attachments but do not use AWS CDN, the content in the main text will be the absolute path address on your AWS.

This is how it appears in the theme MD file:

However, after the content is published, Discourse actually replaces the HTML code with your CDN absolute address.

Therefore, based on the answer above, if you do not select to back up attachments during backup, the attachment content will not be affected during restoration.

### Exception

Attachments are actually affected, mainly due to domain name switching.

We had a domain name switch in the early stages, and although the attachment content was still there, the main text could not be linked. Even reconstructing the HTML could not link them.

At this point, it’s a bit troublesome and might require direct modification in the database.

As long as you don’t arbitrarily change your domain name, this is usually not a problem.

For more detailed discussion, please visit: [Discourse 备份和恢复中有关附件的问题 - Discourse - iSharkFly](https://www.isharkfly.com/t/discourse/16026/1)

---

_[View the full topic](https://meta.discourse.org/t/how-to-back-up-discourse-to-s3-discourse-s3/245552)._
