# 如何从仪表板清除所有历史统计数据

**URL:** <https://meta.discourse.org/t/how-to-clear-all-historical-statistics-from-dashboard/121820>\
**Category:** Data & reporting\
**Created:** [2019年七月1日 18:38 UTC](https://meta.discourse.org/t/how-to-clear-all-historical-statistics-from-dashboard/121820 "2019-07-01T18:38:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Destry\_Hunt](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/destry_hunt/32/132757_2.png) [@Destry\_Hunt](https://meta.discourse.org/u/Destry_Hunt)\
**Post date:** [2019年七月1日 18:38 UTC](https://meta.discourse.org/t/how-to-clear-all-historical-statistics-from-dashboard/121820/1 "2019-07-01T18:38:48Z")

</div>

我克隆了当前在一个域名上运行的现有论坛，以便在另一个域名（以及独立的 VPS）上启动一个几乎相同的论坛。现有论坛的所有配置都完全符合我的要求。我喜欢这些设置、所有标签（这些标签花费了大量精力才配置正确）、置顶主题和分类。然而，我希望新论坛在启动时不包含原论坛在镜像生成时已有的主题、帖子和用户，这样新论坛才能真正算是“全新”的。在通过镜像启动新论坛后，我成功清除了不需要的主题、用户等内容。现在我已准备好开始用户导入，但仪表板中仍显示来自原论坛的统计数据。如何清除这些统计数据？此外，为了确保数据库真正“全新”，后端是否还有其他需要清理的内容（除了统计数据，如页面浏览量等）？另外补充一点，由于我删除了原论坛中的所有主题，某些分类的主题计数显示为负数。

---

<div class="post-metadata">

**Author:** ![Destry\_Hunt](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/destry_hunt/32/132757_2.png) [@Destry\_Hunt](https://meta.discourse.org/u/Destry_Hunt)\
**Post date:** [2019年七月6日 04:24 UTC](https://meta.discourse.org/t/how-to-clear-all-historical-statistics-from-dashboard/121820/2 "2019-07-06T04:24:55Z")

</div>

跟进一下……看来这个问题目前没有解决方案，所以我几乎删除了所有内容并重新构建，结果成功了。

祝好

---

<div class="post-metadata">

**Author:** ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)\
**Post date:** [2019年七月11日 09:39 UTC](https://meta.discourse.org/t/how-to-clear-all-historical-statistics-from-dashboard/121820/3 "2019-07-11T09:39:36Z")

</div>

抱歉，我现在才看到这条消息。对于将来遇到此话题的其他人，您应该可以使用[这份破坏性 rake 任务列表](https://meta.discourse.org/t/administrative-bulk-operations/118349#heading--12)来“重置”Discourse 站点。

与此话题特别相关的是：

> [@tshenry](#):
>
> **销毁站点统计信息**
> 
> ```plaintext
> rake destroy:stats
> 
> ```

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [2023年一月1日 10:31 UTC](https://meta.discourse.org/t/how-to-clear-all-historical-statistics-from-dashboard/121820/4 "2023-01-01T10:31:23Z")

</div>



---

<div class="post-metadata">

**Author:** ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)\
**Post date:** [2023年一月1日 11:13 UTC](https://meta.discourse.org/t/how-to-clear-all-historical-statistics-from-dashboard/121820/5 "2023-01-01T11:13:13Z")

</div>


