1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.3 Accidentally deleted a forum with no back-up

Discussion in 'Troubleshooting and Problems' started by RustyDogma, Jul 6, 2014.

  1. RustyDogma

    RustyDogma Member

    did it 2 minutes ago, can I recover?
  2. RustyDogma

    RustyDogma Member

    I have the admin log with the deleted node #
  3. whynot

    whynot Well-Known Member

    Do you have a trash folder, deleted files ending up there?
    If you do then check it, your forum's folder might be there.
    If you don't than only your host can recover it from an an earlier backup.

    Edit: Ooops, I thought that it was the whole forum.
  4. petertdavis

    petertdavis Well-Known Member

    Ask your host for a backup quick. They may keep backups for you (they might not too), but they also might overwrite the backups on a regular basis (daily probably). And, more importantly, start keeping regular backups of your own.
  5. Jeremy P

    Jeremy P Well-Known Member

    Fortunately, I don't think threads are purged from the database for deleted nodes. I know this was marked a 'future fix' years ago and I don't think it's changed since.

    Would take some SQL ninjaing to fix though.
  6. Chris D

    Chris D XenForo Developer Staff Member

    Unfortunately, I believe it was changed.

    From the Forum DataWriter, postDelete:
            if ($this->getOption(self::OPTION_DELETE_THREADS))
    XenForo_Application::defer('ThreadDelete', array('node_id' => $nodeId), "threadDelete_$nodeId"true);
    That DW option is enabled by default and would require the option to be set to false to override it.

    The only way to be sure is to run this query:
    SELECT * FROM xf_thread WHERE node_id = 123
    Where 123 is the deleted node ID.
    Jeremy P likes this.
  7. RustyDogma

    RustyDogma Member

    It is a forum - a single forum under a category - with brand new threads - a lot of them since my last back-up 24 hours ago.
  8. whynot

    whynot Well-Known Member

    Act quickly: Restore your whole forum from that.
  9. RustyDogma

    RustyDogma Member

    I saw this

    • Create a new, blank forum where the one you deleted was.
    • Once created, make a note of the NEW forum's node_id.
    • Using PHP My Admin or similar, find the xf_node table and find the NEW node in the list. Change the node_id value for the NEW node so it has the node_id of the DELETED node.
    • Still in PHP My Admin, find the xf_forum table and again, find the NEW node in the list. Change the node_id value so that the new node again, has the ID of the old node.

    But I don't want to make things worse, so I'm unsure on how to get the correct node numbers.

    The deleted one is

    array(2) {
      ["node_id"] => string(2) "54"
      ["_xfConfirm"] => string(1) "1"
    So, 54.. but not sure what the new one is.
  10. Chris D

    Chris D XenForo Developer Staff Member

    Easiest thing to do straight away is to run this query:

    SELECT * FROM xf_thread WHERE node_id = 54
    That will tell you whether or not there are any threads left or if they were deleted with the forum.
  11. RustyDogma

    RustyDogma Member

    I contacted my host and my previously working forum is now completely inaccessible. I asked for a back-up and now it gives a db error.

    He asks:

    <!-- Mysqli prepare error: Table 'dominio1_DOforum.xf_data_registry' doesn't exist -->
    but that table is there:
    MariaDB [dominio1_DOforum]> SHOW TABLES LIKE 'xf_data_registry' ;
    | Tables_in_dominio1_DOforum (xf_data_registry) |
    | xf_data_registry |
    1 row in set (0.00 sec)
    MariaDB [dominio1_DOforum]>
    I even dropped that table, but it is still complaining:.
    MariaDB [dominio1_DOforum]> SHOW TABLES LIKE 'xf_data_registry' ;
    Empty set (0.00 sec)
    MariaDB [dominio1_DOforum]>
    Can you check with forum vendor please, what we need to do in order to restore/fix exactly ?
    So pissed, as while I screwed up and deleted a forum, otherwise everything was working fine - I just wanted to restore my mistake. I now have no functional site at all, just a database error.
  12. Brogan

    Brogan XenForo Moderator Staff Member

    How did your host take the backup and restore it?

    We need to know the exact steps.
  13. Chris D

    Chris D XenForo Developer Staff Member

    This query will restore the xf_data_registry table:
        CREATE TABLE xf_data_registry (
            data_key VARBINARY(25) NOT NULL PRIMARY KEY,
            data_value MEDIUMBLOB NOT NULL
        ) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
  14. RustyDogma

    RustyDogma Member

    I asked about the steps and was told all they can do is escalate it. So now my site is down while I wait for some poor tech to wake up on a Sunday morning.
  15. RustyDogma

    RustyDogma Member

  16. Brogan

    Brogan XenForo Moderator Staff Member

  17. Mr Lucky

    Mr Lucky Well-Known Member

    That's what I thought.

    Balance losing a whole forum against losing 24 hours of new posts.
    whynot likes this.
  18. RustyDogma

    RustyDogma Member

    They finally figured out the issue and restored it. Unfortunately they didn't explain what happened where they lost the whole thing for 6 hours, so no helpful updates in that regard.

Share This Page