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
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 execute the following rails task with the current default locale, e.g. “en”.