A prominent member edited out the text of over 300 posts and thereby wrecking hundreds of threads. I need to restore these posts. How can I do this? Is there a query I can use?
How to restore 300 posts to previous edit history?
Collapse
X
-
-
1. Restore your backup to a different database, say test1.
2. In phpMyAdmin, select test1 and click on the post table. Go to the Operations tab and find the Copy table to dialog box. In the dropdown box, select your vb_forums database and and type post77 into the text box. Make sure structure and data is select and click go.
3. You will now have two post tables in your vb_forums database. In phpMyAdmin, select the sql tab and enter the following...
Code:UPDATE post INNER JOIN post77 ON post.userid = post77.userid SET post.pagetext = post77.pagetext WHERE post.userid = XXX
Lats... -
I had a member wig out and do this a few years back. I set the time limit to edit a thread to 24 hours after posting.Comment
-
Thanks Lats - I used a modified version of your INNER JOIN query to restore 280,000 pagetext fields in my posts table that I'd accidentally overwritten. Saved me oodles of work, so very grateful ...Comment
-
Comment
-
Well I'd tried to replace my old domain name with the new one in the pagetext field but messed up the query. Instead of changing the domain name, I ended up writing the word pagetext into the pagetext field of 280,000 records. Nightmare!!!
I didn't know about inner joins before, but hoped there would be a way to copy-over the data from my backup tables and that's when I came across this thread and your query.
I played around with it a bit and this is the query I ended up using:
Code:UPDATE post INNER JOIN post77 ON [COLOR=red]post.postid[/COLOR] = [COLOR=red]post77.postid[/COLOR] SET post.pagetext = post77.pagetext WHERE post.pagetext = [COLOR=red]'pagetext'[/COLOR];
Cheers,
ShaunLast edited by Clickfinity; Fri 19 Feb '10, 12:48pm.Comment
-
Hi everyone. I know this thread is 6 years old, but some people still need this functionality.
I am running vBulletin 4.1.12, and I had the post edit history feature turned ON, but unfortunately there is no way to restore posts.
I worked on it today and came up with this SQL query, and it functioned perfectly:
Code:UPDATE post INNER JOIN postedithistory ON (post.postid = postedithistory.postid AND postedithistory.userid = XXXX AND postedithistory.original = 1) SET post.pagetext = postedithistory.pagetext
This query rolls back ALL edits to the original post made by that user.
Some cautions:
1) BACK UP THE DATABASE FIRST, because if you do this wrong, you will ruin your forum
2) You need a version of vBulletin which supports edit history. You also needed post edit history turned ON (prior to the edits you want to reverse) in order for this to work.
3) I don't know how well this works with vBulletin 5, so again, make sure everything is backed up.Comment
Related Topics
Collapse
-
by ilfllcHi, is it possible to export a single user's posts into csv or another format? Ideally I'd like to export all posts made by a specific user, along with date/time stamps and IP used at the time of posting....
-
Channel: Support Issues & Questions
-
Comment