# 恢复后头像丢失。如何找回？

**URL:** https://meta.discourse.org/t/avatars-lost-after-restore-how-to-get-them-back/148223
**Category:** Support
**Created:** [2020年四月16日 10:43 UTC](https://meta.discourse.org/t/avatars-lost-after-restore-how-to-get-them-back/148223 "2020-04-16T10:43:23Z")
**Posts on this page:** 1
**Showing post:** 30

<div class="post-metadata">

### Author: ![neounix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neounix/32/215617_2.png) [@neounix](https://meta.discourse.org/u/neounix)
#### Post date: [2020年四月18日 07:03 UTC](https://meta.discourse.org/t/avatars-lost-after-restore-how-to-get-them-back/148223/30 "2020-04-18T07:03:02Z")

</div>

> [@riking](#):
>
> 我一直没有回复任何内容，因为我以为可能是某种服务器数据传输失误（未使用内置备份功能）导致 /uploads/ 目录完全丢失，而我完全不知道该如何用你能理解的方式解释这一点。

是的……我们按照这篇指南设置了 nginx 反向代理，但那是针对独立部署的，并未提及上传文件，因为在独立模式下不需要传输这些内容：

> [@Add an offline page to display when Discourse is rebuilding or starting up](https://meta.discourse.org/t/adding-an-offline-page-when-rebuilding/45238):
>
> warning This guide is intended for advanced users, who are already using nginx outside the docker container. By following this guide you make your setup more complicated and will lose some speed benefits like HTTP2 if you’re not running Ubuntu 16.04 or later. Proceed with caution! When Discourse is rebuilding or starting up, your users will usually either see an error message from their browser… …or a not-so-nice 502 error message from Nginx: If you’re a perfectionist …

我们还遵循了这篇关于两个容器的指南，其中同样没有提到进行任何数据库恢复或上传目录的转移：

> [@Move from standalone container to separate web and data containers](https://meta.discourse.org/t/how-to-move-from-standalone-container-to-separate-web-and-data-containers/29413):
>
> warning This is an advanced setup. Don’t follow this unless you are experienced with Linux server administration and Docker. You also need to pay close attention to commits to discourse\_docker to make sure you notice if there’s a version bump for postgres or redis. Converting your Current Setup I managed to migrate to two containers. If anyone else needs instructions, this is how it worked for me. The process includes backup, setting up separate web and data containers and restore data. …

我想我们完全可以理解这些内容。这里是你之前遗漏的关键线索，供参考：

**关于此配置的主要教程遗漏了一个重要事实：你应该要么执行数据库恢复，要么手动将上传文件转移到新容器，因为教程中并未包含这些步骤。**

_当然，在我们完全靠自己搞定这一切（再次！）之后，现在一切都很合理了，毕竟教程里确实没写。哈哈_

**一旦你明白了问题所在，一切都会变得简单。**

🙂 🙂 🙂

PS：最后，感谢所有撰写各种教程的各位。它们对我们帮助很大！非常感谢。在我们这边，此配置已完成，未来我们将不再在任何 Discourse 站点上使用独立配置。我们的“默认”标准将是两个容器配合反向代理连接到 Unix 套接字。这种方式在更新和实时切换容器时几乎零停机，效果最佳。太棒了！！

**Discourse 太棒了！！**

**做得好，Jeff @codinghorror 和 Sam @sam！太棒了！**

❤ ❤

@ariznaf……

这其实很容易配置成功，但正如我之前提到的，我们不使用 S3 或其他云存储服务；我们更喜欢保持“简单”，因此我们的备份只是通过 `rsync` 同步到异地存储。我们更喜欢这种方式……少了一个需要调试的环节 🙂 而且我们完全可以“没有 S3 也能生活”。

---

_[View the full topic](https://meta.discourse.org/t/avatars-lost-after-restore-how-to-get-them-back/148223)._
