No announcement yet.

Lost my first thread

  • Filter
  • Time
  • Show
Clear All
new posts

  • Lost my first thread

    I deleted a forum and lost a thread that was in there, it was threadid=1

    What would i do to get it back, i have the database from when it was there. But new members and posts have come since then.

    What would happen if i uploaded the database over the current one, would it import the thread?
    Running vB since 4-14-2002

  • #2
    postids and threadids are incremented. Once a postid has been used, that number will never be assigned to a post again. So you can safely restore deleted posts under their same id numbers if you have a backup.

    Open your backup file in a text editor and find the query for threadid 1 and the queries for the posts for threadid 1. Run those insert queries on your database.

    Another way to do this would be to restore the backup to a database and eliminate all other threads and posts from it using these queries:

    DELETE FROM thread WHERE threadid <> 1
    DELETE FROM post WHERE threadid <> 1

    Then do a "data only" dump of the post and thread tables using phpmyadmin. Now you have 2 sql files. Run these files on your main database using the same method you would to restore a database:

    mysql -uUSERNAME -p newdbname < /path/to/dump.sql

    With either method, when you are done you will need to run this query to change the forumid of the thread since you deleted the forum it was in.

    UPDATE thread SET forumid=number WHERE threadid = 1


    • #3
      Thanks, i'll do it when i have more time.
      Running vB since 4-14-2002


      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.