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

XF 1.4 Partially restored threads and posts

Discussion in 'Troubleshooting and Problems' started by bayrock, Oct 25, 2015.

  1. bayrock

    bayrock Member

    So, long story short I've accidentally deleted an entire category of my forum. This has consequently deleted all of the content within it too. I jumped into action and obtained a database backup from earlier today.

    I restored the xf_thread and xf_post table successfully, and then created a new category with the corresponding nodes from before. I ran queries in order to replace the old node IDs with the new nodes as such:
    UPDATE xf_thread SET node_id = 67 WHERE node_id = 60
    I did this for each new node I'd created, and then proceeded to rebuild my forums cache. Upon visiting my forum the nodes appeared empty as if they don't exist, but the threads and posts were appearing within them:
    [​IMG] - no messages or posts
    [​IMG] - messages and posts

    My forum statistics also don't reflect the threads or posts being restored. I know this could be perplexing but does anyone know how I might fix this?

    I'm reaching the end of my chain on this mistake.
    Last edited: Oct 25, 2015
  2. Brogan

    Brogan XenForo Moderator Staff Member

    There is a lot of interconnected data related to nodes and posts.

    I could only recommend restoring from a complete backup.
  3. bayrock

    bayrock Member

    That was what I tried initially, but after digging around with our nginx config for ages I was unable to increase the max filesize so that I could import the entire database. I managed to get and import the xf_thread and xf_post tables instead.

    I can restore each table one by one. Is that my course of action? Would you know what tables pertain to the issues I'm having with forum and node statistics?
    Last edited: Oct 25, 2015
  4. Tracy Perry

    Tracy Perry Well-Known Member

    If using nginx, I'm going to assume (bad thing to do I know) that you are on a VPS or dedi. Why not do the DB import from the terminal CLI.
  5. bayrock

    bayrock Member

    I'm not extremely familiar with nginx or the Linux server that we've got it installed on. Just enough that I could alter the max filesize accepted by nginx/apache and reload the services (which didn't seem to work).

    If you could point me in a direction I might find how to do the import from the terminal I'd appreciate that.
  6. Tracy Perry

    Tracy Perry Well-Known Member

    Appears (by your nginx/apache statement) you are using nginx as a proxy. I'm not really familiar with that setup, so can't guide you. Do you not have SSH access to the server? If you do, simply FTP the DB backup to it and then use the command line in a shell to import the DB into mysql.
  7. bayrock

    bayrock Member

    I do have access to SSH, and I can FTP the DB backup to it. I get confused at the point of importing it via command line as I've never done that sort of operation. Thanks for the information; I'll look into it.

    edit: I've magically fixed my filesize error, and managed to do a full restore of the database:

    Thanks for quick answers to those who gave advice! After much effort this is resolved now.
    Last edited: Oct 25, 2015
  8. Tracy Perry

    Tracy Perry Well-Known Member

    For the future, you can import it simply by using
    mysql -l<DB_username> -p DB_name < import_DB.sql
    Where DB_username is the username that is for your forum DB, the DB_name is the name of the DB the forum uses and the import_DB.sql is the exported .SQL file that is your backup.

    Further, I would not get to depending on using php MyAdmin to do backups with (if that's what you are using) as it's a export corruption waiting to happen.

Share This Page