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

XF 1.1 Manually importing a forum node from db backup

Discussion in 'Installation, Upgrade, and Import Support' started by Mendo, Dec 3, 2012.

  1. Mendo

    Mendo Member

    Does anyone know what tables I would need to be looking in if I was manually copying a forum node from a db backup? `xf_node` has the forum names but everything else must have it associated with it's node id which is making it particularly difficult for me to figure this one out.
  2. Sadik B

    Sadik B Well-Known Member

    I am assuming there are too many forum nodes, hence you are not doing it from the backend.

    Look at the actionSave method of XenForo_ControllerAdmin_Forum class. What you can do, is write a simple addon (or add a method to an existing addon) which queries your old database for the input data required by the actionSave method and then has the same code as the actionSave method to write the data. This would be quicker and would take care of all dependencies.
    Jake Bunce likes this.
  3. Mendo

    Mendo Member

    I had backed up my XenForo db in .sql file, then a forum node got deleted on accident. I'm trying to find the proper tables to insert back in to get it back. So far all I've found is the line in `xf_node`, and I know the 'node id' of it, but I don't know what table the rest is in.
  4. Mendo

    Mendo Member

    I'm afraid this went a bit over my head, would it still work with an .sql file backup?
  5. Sadik B

    Sadik B Well-Known Member

    Have you just lost the forum node or all threads, posts in it?

    If you mean you have lost all threads and posts in a forum, the easiest way would it through sql queries.

    There are various ways you can restore the threads and posts but here are the steps I would do,

    1. Restore the backup in a new db, preferably locally.
    2. Query the xf_thread and xf_post table for rows with that node_id.
    3. Export these rows in a sql file with a tool which can export them as INSERT statements.
    4. In your live site, create a new node and note the id.
    5. Open the sql files exported in step 2 and do a find and replace for the node_id
    6. Import the sql files on your live site.

    If you are not comfortable, you should probably hire someone. This should be doable in 2-3 hours. And apologies because I am not available...

    Jake Bunce likes this.
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Rudy and Sadik B like this.
  7. Mendo

    Mendo Member

    Yeah all the threads are still there. And when I put the node in xf_node I can see it on my node list but I cannot edit it and it shows 0 threads being there. I'd prefer to make new forum and re-associate as a last resort, is there no way to know which tables the missing node info is kept?
  8. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Just create a new node. It's the same difference, and it's easier. There is no reason not to go this route.
  9. Millard Baker

    Millard Baker Member

  10. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

Share This Page