PDA

View Full Version : Database Query to run to restore Thread Post


TheAllusionist
10-27-2016, 02:38 PM
Yesterday it appears that when I installed a jFusion module in Joomla to read vBulletin 4 latest post that it took one thread (most popular one on site of course) and put me (adminsitrator) as the last and only post in the thread all the way back to around 3/26/2014.

So I contact the collocation facility that host my server and that I pay monthly for extra storage backup to revert the database and they get back to me and say, apparently things haven't been backing up for a long time and what we do have seems corrupted. Well the last backed up database for vBulletin I have is from 12/15/15 and it doesn't seem to want to work, could be just some new or updated plugins, etc. are causing a problem, but if I did get it to work, who knows if something somewhere not readily noticeable is wrong.

So I would like to run a query to update the database tables with that last database for the thread " Forum: Architectural Designs - On the Drawing Board (id: 23)" and restore what I can at least and then I will delete the ones I can't do anything about. Could I get some help on how to track down in the SQL file the information I need and the query on the database that I need to run to install it? I have of course backed up my current database.

Site is 3dallusions.com Thanks in advance,

Russell

Dave
10-27-2016, 02:40 PM
So if I understand you correctly, you have a thread that had all of its posts removed and you want to restore the posts of that specific thread again from a backup database?

Lynne
10-27-2016, 03:01 PM
Take a look at this:

Restoring a thread - http://www.vbulletin.com/forum/showthread.php?326281-Recreating-a-deleted-thread-number&p=1845274&viewfull=1#post1845274:

Try this, restore the backup to a different database and using the operations tab in phpmyadmin, rename the thread and post tables to something with a number on the end (post7 and thread7) then copy those 2 tables to the live database.
Run the following queries changing 777 to the threadid of the deleted thread.
Code:

INSERT INTO thread
(SELECT *
FROM thread7
WHERE threadid = 777)

Code:

INSERT INTO post
(SELECT *
FROM post7
WHERE threadid = 777)


DO NOT do this on your live site first!!!! Do it on a test site to see if it works. There is nothing above about restoring any attachments, so you will need to live without those (if they were stored in the database, then you may be able to write the queries for those). After you do it on a test site and verify everything works, then do a backup of your live site. Only after backing up your live site should you do this query there.

TheAllusionist
10-27-2016, 03:12 PM
Dave, yes and Lynne thanks. Attachments are files as my site is all about graphics and database would be huge, as it is it is 150 megs.