How to regenerate FAQ and TOS pages?

Hi everyone,

I may have deleted FAQ and TOS pages by mistake and I now have a spinning wheel when I click on the FAQ link on the hamburger menu, and “topic not found” for the TOS.

Should I just create these topics? Will they have the same link?
Is there a command to re-build these core files?

Thank you.

Interesting. How did you manage to delete those topics? You shouldn’t be allowed to delete them in the UI.

First, let’s see if the topics are really gone.

./launcher enter app
rails c
Topic.with_deleted.exists?(SiteSetting.guidelines_topic_id)
Topic.with_deleted.exists?(SiteSetting.tos_topic_id)

If the topics are really gone, create two new topics in the Staff category and assign the topic ids in the rails console to the site settings.

SiteSetting.guidelines_topic_id = 4711 # replace with topic id
SiteSetting.tos_topic_id = 4712 # replace with topic id

SiteSetting.default_locale

And then execute the following rails task with the current default locale, e.g. “en”.

rake topics:update_static[en]
9 Likes

Thank you so much @gerhard. Very helpful as always.
As soon as I get at a computer I’ll check this out.

We had a failed migration and wanted to keep discourse settings while deleting the migrated topics/categories. And because we had a “trash” folder with about 70k topics of trash, all written by “system”, we had to forcefully clear from the DB all topics created.

Is this the command for the “/privacy” page?

SiteSetting.privacy_topic_id = 4712 # replace with topic id

Thank you.

3 Likes

Yes, that’s the correct site setting.

2 Likes
[1] pry(main)> **Topic** .with_deleted.exists?( **SiteSetting** .guidelines_topic_id)
=> **false**
[2] pry(main)> **Topic** .with_deleted.exists?( **SiteSetting** .tos_topic_id)
=> **false**
[3] pry(main)>

They were indeed missing as suspected.

Thank you so much. It worked like a charm.

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.