Jump to content

Restoring ONE topic (along with posts, etc) from db backup?


Shariq Ansari

Recommended Posts

Posted

Since IPS4 removed the undelete/soft delete functionality, we actually haven't had any problems... until today, when someone deleted a two-year old thread of their own that they care passionately about...

I've got a database backup from yesterday... I don't want to restore it and lose everything that's happened today...

Is there any documentation, or does anyone know, the specific queries one would have to execute to migrate a SINGLE topic, along with all its posted and associated data structures, from a backup/separate database (same IPS version, 4.1.9) into the current, live database?

Posted

You would have to look for the topic in forums_topics, then find all the posts related to that topic in forums_posts.

If you have a database backup then they should all be queries ready to copy and paste into what ever database manager you use.

Posted
4 minutes ago, Hulu said:

You would have to look for the topic in forums_topics, then find all the posts related to that topic in forums_posts.

If you have a database backup then they should all be queries ready to copy and paste into what ever database manager you use.

Thanks... do you know for sure that things are limited to just those two tables? What I'm worried about is other obscure system tables that might get touched or stuff like that... those two I know about and make sense... if they're good enough, that's great... any way to be sure about that?

Posted

Any attachments in the thread may have been irrecoverably lost, but I think they are just cleaned up by a task, so it you recover it quickly it should be OK. You're looking in core_attachments_map where location_key=forums_Forums (I think), and id1 is the topic ID. Those rows will have been deleted from the db, but you want to recover them before the actual files are removed.

The tag cache and search index will be messed up - tags probably don't matter, but the search index probably does, and is harder to fix. I think you need to run some manual PHP code calling \IPS\Content\Search\Index::i()->index( $comment ); where comment is each post in the thread.

All follows for the topic will have been removed, as well as all notifications about it.

If there was a poll, that will have been removed too.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...