# How should category archiving work?

**URL:** https://meta.discourse.org/t/how-should-category-archiving-work/32895
**Category:** Feature
**Created:** [2015 年 9 月 4 日午前 12:03 UTC](https://meta.discourse.org/t/how-should-category-archiving-work/32895 "2015-09-04T00:03:40Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2015 年 9 月 4 日午前 12:03 UTC](https://meta.discourse.org/t/how-should-category-archiving-work/32895/1 "2015-09-04T00:03:41Z")

</div>

We have a request from a customer that I’ve been expecting for a while:

> We want to remove the beta and alpha categories, and all topics in those categories

Meaning, there are a whole lot of posts in those alpha and beta categories that represent the state of their software at a much older point in time, such that **all the topics there are basically irrelevant, forever.** (This is also video game software, where after 3 years a game is forgotten forever and never played again, so old beta/alphas of games are _especially_ irrelevant in the world of software.)

The intent of the “archive” action on a topic is **to prepare it for eventual archiving**. Now that _may_ mean deleting it. Or it could mean moving it to some kind of historical long term offline archives. At any rate, an archive is something that is

- not of practical current interest
- _might_ be useful _very rarely_ to someone digging through long term history for obscure reasons
- helpful to remove from the current active instance to make room for newer, more relevant _current_ content

I believe archiving should be triggered either by:

- archiving out **all topics with a state of archived**
- archiving out **all topics in a particular category**

I’m not sure we can physically remove the posts and topics from the database without extreme trauma to our codebase, so perhaps the only alternatives are to

1. delete (all our deletes are soft deletes) every topic in the category
2. mark the _category_ as archived, and have special handling for topics in archived categories

Then, produce an export file of the archived topics.

This also implies there is a way to selectively bring back a set of archived posts, or an archived category, which is probably way too hard.

I guess the simple thing to do, for now, is

- just mark every topic in the category (or all archived topics) as deleted for now.
- make sure we have an ‘archived’ category state (perhaps a date of archive) to look at later.

Any thoughts here?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2015 年 9 月 4 日午前 3:25 UTC](https://meta.discourse.org/t/how-should-category-archiving-work/32895/2 "2015-09-04T03:25:51Z")

</div>

There is another option that can work quite well, make the category a staff only category.

This effectively “removes” all the posts in one very quick go. Its clean, has simple undo and very minimal side effects that are “staff only”.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2015 年 9 月 4 日午前 4:13 UTC](https://meta.discourse.org/t/how-should-category-archiving-work/32895/3 "2015-09-04T04:13:46Z")

</div>

That is the way they have it now (I actually checked for that earlier), and it is not what they want.

It is just unnecessary clutter for them at this point, a bunch of obsolete content.

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [2015 年 9 月 4 日午前 4:45 UTC](https://meta.discourse.org/t/how-should-category-archiving-work/32895/4 "2015-09-04T04:45:12Z")

</div>

maybe you could provider an admin setting for “archived categories” or some such - add category names there that you want to disappear forever.

nice aspect of that would be that it really removes all the posts in one go, and is reversible, and even the admins won’t be able to see the posts.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [2015 年 9 月 4 日午前 5:18 UTC](https://meta.discourse.org/t/how-should-category-archiving-work/32895/5 "2015-09-04T05:18:50Z")

</div>

Should there not be some way for normal users who are not forum admins to access the archives somehow? Or would that be part of the “special handling”.

Perhaps if we made sure that the archive file was sanitized of secret information, then they could be put up for download. Even if we don’t want it to be searchable.

If the posts get actually removed from the database, we could eventually get a screen like this:

> **This topic has been archived.**

> If you want to view it, click below and give us a minute to dig it up.

> [View Archived Topic] Download archive of Alpha (2013-2014) (0.5GB)

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [2015 年 9 月 4 日午前 10:17 UTC](https://meta.discourse.org/t/how-should-category-archiving-work/32895/6 "2015-09-04T10:17:25Z")

</div>

If the **removal** of the content is the point, then a soft delete like you mention (assuming hard deletes are a problem) should be applied on all of the content, _and_ all of these topics & posts should be excluded from the default backup. Instead, when you do the archiving, they should be put in a separate “Archives” backup of their own.

If you just don’t want your searches getting polluted & slowed down with deprecated posts, and you don’t want archived categories cluttering up your category list, then a “do not search” flag on archived post and a special category that doesn’t show even in staff lists (but retrievable through admin panel somehow) would suffice. Essentially making all topics Unlisted, plus special treatment of the category visibility.

We’ve talked about similar things before:

> [@Should old topics be deleted from this forum?](https://meta.discourse.org/t/should-old-topics-be-deleted-from-this-forum/19070):
>
> This seems worthy of its own discussion topic for the community here to weigh in on in the ‘meta’ sense (continuing the discussion from [Notification when a moderator or admin deletes your message](https://meta.discourse.org/t/notification-when-a-moderator-or-admin-deletes-your-message/18875/36)): What kind of topics should be deleted from this forum? Should they be handled in some other way?

> [@Best practices for archiving topics](https://meta.discourse.org/t/best-practices-for-archiving-topics/27069/12):
>
> Is there a difference in search engine visibility for Archived topics? I for one would like to see archived topics be not-indexed by Google and co., and be invisible or deprioritized in the in-Discourse search. This for many of the reasons stated [here](https://meta.discourse.org/t/should-old-topics-be-deleted-from-this-forum/19070), but still leaving the topic around for people who have the link or otherwise know where it is…

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2016 年 1 月 25 日午前 7:12 UTC](https://meta.discourse.org/t/how-should-category-archiving-work/32895/7 "2016-01-25T07:12:44Z")

</div>

There may also be some mapping here for **moving a category to a different Discourse instance** , which we have at least one paying customer wanting to do

> What we need:
> 
> - Copy one category
> - Copy all of its sub-categories (10)
> - Copy all posts in these categories (\<50)
> - Copy all members that belong to the custom group; keep current usernames, email and passwords of these users on the new forum

Same basic area of work, IMO. Splitting one Discourse into another is a logical thing to do, only difference I can see in this case is that instead of transferring the entire category to `/dev/null` we are **copying** it to another Discourse instance..

Anyway keep that in mind as we work on this @neil!

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2016 年 1 月 25 日午前 7:42 UTC](https://meta.discourse.org/t/how-should-category-archiving-work/32895/8 "2016-01-25T07:42:40Z")

</div>

Moving category spec is here:

> [@CLI command to migrate a single category](https://meta.discourse.org/t/cli-command-to-migrate-a-single-category/35728):
>
> We need to build a general purpose tool for moving a category from one Discourse instance to another. This has come up on one of our customers and is also useful for a variety of use cases: Use cases for category import / export (current need) During huge migrations we may need to avoid long term downtime, so we need to run a temporary site on one domain and then ship the content (eventually) to the new imported site In some cases category partitioning is not strong enough, we have seen t…

---

<div class="post-metadata">

### Author: ![mattdm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mattdm/32/216484_2.png) [@mattdm](https://meta.discourse.org/u/mattdm)
#### Post date: [2021 年 11 月 1 日午後 7:57 UTC](https://meta.discourse.org/t/how-should-category-archiving-work/32895/9 "2021-11-01T19:57:59Z")

</div>

これはかなり古い話ですが、Ask Fedora の Discourse サイト自体が数年経ちつつあるため、この問題について考えています。そのフォーラムはエンドユーザーのトラブルシューティング用ですが、一部のトピックは時代を超えて有用であり（過去の議論を掘り起こすことで、それが新しい問題なのか、あるいはなぜそのような状態になったのかの経緯を理解するのに多少役立つこともあります）、最も古いトピックは Fedora Linux 29 時代のものです。Fedora Linux 36 のリリースを目前に控え、状況は大きく変化しています。

そこで、非常に古いリリース（当サイトの「迅速な変化」のペースに照らせば、3 年以上前のもの）のトピックについては、以下のような扱いにしたいと考えています：

- サイト内検索結果から除外する（ただし、明示的に検索された場合を除く）
  - 類似トピックとして提案されることは、確実に避ける

- Google 検索からも非表示にするか？（まだ確信はありません）
- 返信を無効化するが…
- 発見した人が何か意見を述べたい場合に、そのトピックを簡単に参照できるよう、「+ 新しいトピック」リンクを目立たせる

（実際、最後の点は「クローズド済み」の投稿にも適用できると良さそうです！）

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2021 年 11 月 1 日午後 10:46 UTC](https://meta.discourse.org/t/how-should-category-archiving-work/32895/10 "2021-11-01T22:46:52Z")

</div>

Discourseのスタッフは、閉じられたスレッドや役に立たない投稿を削除する際にかなり容赦ありません。探しているものが見つからないとたまに悲しくなりますが、頻繁ではありません。自動システム（ひどい間違いを犯す可能性があります）よりも、積極的なモデレーションの方が良いと思います。
