XF 1.1 Manually importing a forum node from db backup

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.
 
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.
 
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.
 
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.
I'm afraid this went a bit over my head, would it still work with an .sql file backup?
 
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...

Regards
 
Threads are not deleted when you delete a node. I suggest creating a new node in your Admin CP, then run a simple query to reassign the threads:

http://xenforo.com/community/threads/move-all-discussions-in-one-node-to-another.36005/#post-409341
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?
 
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?

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