Undelete A Category? (Or the "about this category" topic that was under it)

I spent some time searching, but didn’t find anything directly related to this…
Is there a way to undelete a category? More specifically I need to recover the “about this category” topic that resided from a newly created category… that I then deleted.

Tried poking around with different URLs in my browser history but no luck. Backup is no good as this all happened in the last 20 mins or so and backups are daily.

Backstory:

  • I created a “parent” classifieds category with two sub categories.
  • Spent a bunch of time writing the guidelines under the “about this category topic” on that parent.
  • Moved the two sub categories to the “root” as there was no need for the parent really…
  • Then went on to delete the original parent category, along with the about this category topic,

Appreciate any ideas folks might have. I’m not developer, but I can poke around in DB or rails if needed with guidance.

2 Likes

Welp, any ideas? I’m not even sure what I’d search for in the DB.

From working backwards with the topicID in the URL, the topicID that I think I need to recover is 7078, perhaps I can do something with this number?

I guess
./launcher enter app
then
rails c
and
Topic.with_deleted.where(id: 7078).recover!

…but I tried and didn’t work as expected. Not sure why :thinking: You’d have to change its category_id too I think.

With the post number you could try:
Post.with_deleted.where(id: the_post_id).pluck("raw")
or as there was probably only one post in the topic:
Post.with_deleted.where(topic_id: 7078).pluck("raw")

That should give you something to copy :crossed_fingers:

1 Like

Thanks, this got me the text from the post which is good enough!