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

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


And then replace the content of those topics by using the “Manual Update” described in Update seeded categories and topics


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.


Yes, that’s the correct site setting.

[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.


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