Short and silly, our staff category was deleted a while ago, is there any (non backup) way to restore this or manually re-create? Can I squeeze the tables back in from a vanilla backup?
The automated nginx reports have nowhere to post now…
Reinstate Staff Category
The staff category was deleted, and users are seeking ways to restore it. lxk initially asked if it’s possible to manually recreate the category or restore it from a vanilla backup.
lxk later shared a solution by accessing the Discourse DB, finding the ID of the deleted category, and reassigning it to the staff_category_id using SQL commands.
However, dax encountered an issue while trying to replicate the steps, as the staff_category_id doesn’t exist in the DB after migrating from a stable version to a beta version. dax is seeking a workaround for this problem.
Short and silly, our staff category was deleted a while ago, is there any (non backup) way to restore this or manually re-create? Can I squeeze the tables back in from a vanilla backup?
The automated nginx reports have nowhere to post now…
righto so I think I’ve fixed it, roughly here’s how
Entered Container
./launcher enter db-container
Accessed Discourse DB
su -c 'psql discourse' postgres
Had a look at the values of the deleted category
SELECT * FROM site_settings where name = 'staff_category_id'
This returned ID: 4
Found the Category ID of newly created staff category
SELECT id FROM categories WHERE name = 'new staff channel'
This returned ID: 15, which I re-assigned to the staff_category_id
UPDATE site_settings
SET value='15'
WHERE id='4';
AND name='staff_category_id'
I have the same issue, but my problem (I think it’s related to the fact that we have migrated from the stable version to the beta version after deleting the staff category) is that when I run the command
SELECT * FROM site_settings where name = 'staff_category_id'
the result is nothing.
It seems that the id of the staff category does not exist in the container.
Any workaround?